using Blahblah.FlowerApp.Data; using System.Net.Http.Json; namespace Blahblah.FlowerApp; internal sealed class Extensions { public static async Task FetchAsync(string url, CancellationToken cancellation = default) { using var client = new HttpClient(); var authorization = Constants.Authorization; if (authorization != null) { client.DefaultRequestHeaders.TryAddWithoutValidation("Authorization", authorization); } return await client.GetFromJsonAsync($"{Constants.BaseUrl}/{url}", cancellation); } }