6.64Collaboration with DelegatingHandler

Created on Aug 17, 2026~1 min read

When you create an HttpClient via services.AddHttpClient(), .NET provides you with a HttpClientHandler by default as the "endpoint" of the pipeline. All DelegatingHandler instances added through .AddHttpMessageHandler<T>() are wrapped outside the HttpClientHandler, forming the following call chain:

text
CustomHandler3 → CustomHandler2 → CustomHandler1 → HttpClientHandler → Network

That is to say:

  • Requests start from the outermost DelegatingHandler and are passed inward layer by layer;
  • Responses return from HttpClientHandler and are passed back outward layer by layer;
  • HttpClientHandler is the only component that actually issues network requests.