public Task <HttpResponseMessage> GetAsync(HttpClientConfigName httpClientConfigName, string absolutePath, CancellationToken cancellationToken) { HttpClient httpClient = _httpClientFactory.CreateClient(httpClientConfigName.ToString()); HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, absolutePath); return(httpClient.SendAsync(request, HttpCompletionOption.ResponseHeadersRead, cancellationToken)); }
public Task <HttpResponseMessage> GetAsync(HttpClientConfigName httpClientConfigName, string absolutePath, object content, CancellationToken cancellationToken) { HttpClient httpClient = _httpClientFactory.CreateClient(httpClientConfigName.ToString()); HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, absolutePath); request.Content = new StringContent(JsonConvert.SerializeObject(content), Encoding.UTF8); return(httpClient.SendAsync(request, HttpCompletionOption.ResponseHeadersRead, cancellationToken)); }