diff --git a/Iyzipay/RestHttpClientV2.cs b/Iyzipay/RestHttpClientV2.cs index 9d471fd..aeaeacd 100644 --- a/Iyzipay/RestHttpClientV2.cs +++ b/Iyzipay/RestHttpClientV2.cs @@ -88,7 +88,7 @@ public async Task PostAsync(String url, Dictionary headers requestMessage.Headers.Add(header.Key, header.Value); } - HttpResponseMessage httpResponseMessage = HttpClient.SendAsync(requestMessage).Result; + HttpResponseMessage httpResponseMessage = await HttpClient.SendAsync(requestMessage); var readAsString = await httpResponseMessage.Content.ReadAsStringAsync(); var response = JsonConvert.DeserializeObject(readAsString); response.AppendWithHttpResponseHeaders(httpResponseMessage); @@ -141,7 +141,7 @@ public async Task PutAsync(String url, Dictionary headers, requestMessage.Headers.Add(header.Key, header.Value); } - HttpResponseMessage httpResponseMessage = HttpClient.SendAsync(requestMessage).Result; + HttpResponseMessage httpResponseMessage = await HttpClient.SendAsync(requestMessage); var readAsString = await httpResponseMessage.Content.ReadAsStringAsync(); var response = JsonConvert.DeserializeObject(readAsString); response.AppendWithHttpResponseHeaders(httpResponseMessage); @@ -221,7 +221,7 @@ public async Task DeleteAsync(String url, Dictionary heade requestMessage.Headers.Add(header.Key, header.Value); } - HttpResponseMessage httpResponseMessage = HttpClient.SendAsync(requestMessage).Result; + HttpResponseMessage httpResponseMessage = await HttpClient .SendAsync(requestMessage); var readAsString = await httpResponseMessage.Content.ReadAsStringAsync(); var response = JsonConvert.DeserializeObject(readAsString); response.AppendWithHttpResponseHeaders(httpResponseMessage);