Sending asynchronous HTTP GET request and reading JSON request

suggest change
public static async Task<TResult> GetAnsync<TResult>(this Uri uri)
    using (var client = new HttpClient())
        var message = await client.GetAsync(uri);

        if (!message.IsSuccessStatusCode)
            throw new Exception();

        return message.ReadAsAsync<TResult>();

. . .

public class Result
    public double foo { get; set; }

    public string bar { get; set; }

var uri = new Uri("");
var result = await uri.GetAsync<Result>();

Feedback about page:

Optional: your email if you want me to get back to you:

Table Of Contents