public void DeleteData(string requestUri) { using (var client = new HttpClientConfiguration().GetConfiguration()) { HttpResponseMessage response = client.DeleteAsync(requestUri).Result;; } }
public void PostData <T>(string requestUri, T value) { using (var client = new HttpClientConfiguration().GetConfiguration()) { HttpResponseMessage response = client.PostAsJsonAsync(requestUri, Mapper.Map <T>(value)).Result; } }
public T GetData <T, U>(string requestUri) { string responseData = null; using (var client = new HttpClientConfiguration().GetConfiguration()) { HttpResponseMessage response = client.GetAsync(requestUri).Result; if (response.IsSuccessStatusCode) { responseData = response.Content.ReadAsStringAsync().Result; } } return(Mapper.Map <T>(JsonConvert.DeserializeObject <U>(responseData)));; }