IHttpClientFactory
The ASP.NET Core factory that creates configured HttpClient instances, reusing connections and attaching handlers such as resilience.
In more detail
Creating and disposing HttpClient objects by hand can exhaust network sockets under load. builder.Services.AddHttpClient<IInventoryClient, InventoryClient>() registers a typed client that receives its HttpClient by injection.
Related terms
- HttpClient — The .NET class for sending HTTP requests and reading responses.
- AddStandardResilienceHandler — A one-line setup that adds a recommended resilience pipeline, including rate limiting, total timeout, retry, circuit breaker and attempt timeout, to an HttpClient.
Taught in
- Retry and Circuit Breaker Policies with Polly — Modern .NET Core, C# & Enterprise Microservices