Instantly share code, notes, and snippets.

Embed
What would you like to do?
Use ConfigureAwait(false) for preventing the deadlock.
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