Skip to content

Commit 80fef24

Browse files
committed
Use SendAsync instead of Send for Android compatibility
1 parent f2ba0ee commit 80fef24

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

LessAnnoyingHttp/Http.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public static Response Get(string endpoint, Header[]? headers = null) {
2929

3030
HttpResponseMessage response;
3131
try {
32-
response = client.Send(request);
32+
response = client.SendAsync(request).Result;
3333
} catch (TaskCanceledException) {
3434
throw new TimeoutException($"Timeout waiting for response for request to {endpoint}");
3535
} catch (Exception e) {
@@ -54,7 +54,7 @@ private static Response BodyRequest(string endpoint, HttpMethod method, string b
5454

5555
HttpResponseMessage response;
5656
try {
57-
response = client.Send(request);
57+
response = client.SendAsync(request).Result;
5858
} catch (TaskCanceledException) {
5959
throw new TimeoutException($"Timeout waiting for response for request to {endpoint}");
6060
} catch (Exception e) {

0 commit comments

Comments
 (0)