Created
January 19, 2018 16:14
-
-
Save Majirefy/580870a985532f8ab623bdf8afaf11b1 to your computer and use it in GitHub Desktop.
Use ConfigureAwait(false) for preventing the deadlock.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static async Task<JObject> GetJsonAsync(Uri uri) | |
{ | |
using (var client = new HttpClient()) | |
{ | |
var jsonString = await client.GetStringAsync(uri).ConfigureAwait(false); | |
return JObject.Parse(jsonString); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment