Пример #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);
        }
Пример #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);
        }
Пример #3
0
 public async Task SendDeleteAsync(string id)
 {
     _client.AddAuthBearer();
     await _client.DeleteAsync($"{BaseUrl.SetDepartmentUrl()}/{id}");
 }
Пример #4
0
 public async Task <string> SendGetAsync()
 {
     _client.AddAuthBearer();
     return(await _client.GetStringAsync(BaseUrl.SetDepartmentUrl()));
 }