Esempio n. 1
0
        public async Task <HttpResponseMessage> SendPostAsync(string content)
        {
            _client.AddAuthBearer();
            using (HttpResponseMessage response = await _client.PostAsync(BaseUrl.SetDepartmentUrl(),
                                                                          new StringContent(content, Encoding.UTF8, "application/json")))

                return(response);
        }
Esempio n. 2
0
        public async Task <HttpResponseMessage> SendPutAsync(Department department, string content)
        {
            _client.AddAuthBearer();
            using (var response = await _client.PutAsync($"{BaseUrl.SetDepartmentUrl()}/{department.Id}",
                                                         new StringContent(content, Encoding.UTF8, "application/json")))

                return(response);
        }
Esempio n. 3
0
 public async Task SendDeleteAsync(string id)
 {
     _client.AddAuthBearer();
     await _client.DeleteAsync($"{BaseUrl.SetDepartmentUrl()}/{id}");
 }
Esempio n. 4
0
 public async Task <string> SendGetAsync()
 {
     _client.AddAuthBearer();
     return(await _client.GetStringAsync(BaseUrl.SetDepartmentUrl()));
 }