public static async Task <T> GetAndDeserializeAsync <T>([NotNull] this HttpClient client, [NotNull] Uri url, [NotNull] JsonSerializerOptions options) { client = client.ArgumentNotNull(); url = url.ArgumentNotNull(); options = options.ArgumentNotNull(); using (HttpResponseMessage response = await client.GetAsync(new Uri(url.PathAndQuery)).ConfigureAwait(false)) { _ = response.EnsureSuccessStatusCode(); var stringResponse = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return(JsonSerializer.Deserialize <T>(stringResponse, options)); } }