IHttpClientFactory

IHttpClientFactory is the recommended ASP.NET Core way to create HttpClient instances safely, with pooling, policies and typed clients.

IHttpClientFactory manages HttpClient lifetimes and configuration in ASP.NET Core, avoiding socket exhaustion and enabling retries/timeouts via policies.

  • Named and typed clients
  • Centralised headers, base URLs and timeouts
  • Plugs into resilience policies (e.g. retries)