HttpClient Factory
The built-in way to create and configure HttpClient instances safely.
What is HttpClient Factory?
The HttpClient factory (AddHttpClient) creates and manages HttpClient instances correctly, avoiding exhausted connections and stale DNS, and lets you configure each client in one place.
builder.Services.AddHttpClient<WeatherClient>(c => c.BaseAddress = new Uri("https://api.weather.example.com"));
Level: Journeyman · More ASP.NET Core terms at this level
Updated