What is IHttpClientFactory?

Updated Apr 28, 2026

Short answer

It is used to create and manage HttpClient instances efficiently.

Deep explanation

IHttpClientFactory prevents socket exhaustion and provides a centralized way to configure HttpClient with policies like retries.

Real-world example

Calling external APIs reliably in microservices.

Common mistakes

  • Creating HttpClient manually per request.

Follow-up questions

  • What is socket exhaustion?
  • What is a typed client?

More .NET Core interview questions

View all →