DelegatingHandler
DelegatingHandler is a .NET HttpMessageHandler base class that forwards requests and responses to an inner handler while permitting additional processing.
.NET MAUI in Action
A delegating handler is an HTTP message handler that can inspect or modify a request or response before passing it to another handler.
- How it is used
- Automates authenticated HTTP requests by attaching access-token headers through an HttpClient handler pipeline.
- How deep it goes
- Explains inheritance, SendAsync, request modification, dependency-injection registration, named clients, and handler chaining.
- Examples
- Demonstrates MauiStockTake's AuthHandler, AuthService login flow, named authenticated client, and chained request handlers.
- What you can do after
- Configure an HttpClient that automatically adds authentication headers and composes multiple request policies.
ASP.NET Core in Action, 3e
DelegatingHandler is a .NET HttpMessageHandler base class that forwards processing to an inner handler while allowing additional behavior.
- How it is used
- Applies cross-cutting behavior such as authentication, logging, and metrics to requests made through named or typed clients.
- How deep it goes
- Explains derivation, SendAsync, dependency-injection registration, pipeline ordering, and request-response flow.
- Examples
- Demonstrates an API-key handler and its registration alongside transient error handling for ExchangeRatesClient.
- What you can do after
- Build custom request behavior, register it with dependency injection, and apply it to selected HttpClient pipelines.
Read how ASP.NET Core in Action, 3e explains DelegatingHandler →
Related concepts
- AddHttpMessageHandlerused by · AddHttpMessageHandler is an IHttpClientBuilder extension method that adds a delegating handler type to an HttpClient handler pipeline.
- custom HttpMessageHandlerincludes · A custom HttpMessageHandler is an application-defined HTTP pipeline component that modifies or observes requests and responses.
- HttpMessageHandlerkind of · HttpMessageHandler is an abstract .NET component that processes HTTP request and response messages within an HttpClient handler chain.
- HTTP clientuses · An HTTP client is software or an API component that sends HTTP requests and receives and processes HTTP responses.
- single responsibility principleimplements · The single responsibility principle is a software design principle that gives a component one focused responsibility and one primary reason to change.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

