public async Task PostAsync(string uri, string data)
{
HttpResponseMessage response = await _client.PostAsync(uri, new StringContent(data, Encoding.UTF8, "application/json"));
string content = await response.Content.ReadAsStringAsync();
if (!response.IsSuccessStatusCode)
{
var responseMessage = "Response status code does not indicate success: " + (int)response.StatusCode + " (" + response.StatusCode + " ). ";
throw new HttpRequestException(responseMessage + Environment.NewLine + content);
}
}