6.58DelegatingHandler Request Processing Delegation (Interception)
Created on Aug 17, 2026~2 min read
DelegatingHandler is an important component of the HttpClient class in C#, and it allows you to process HTTP requests and responses in a chained manner. DelegatingHandler is an abstract class typically used to create custom message handlers that can be inserted into the HTTP message processing pipeline. By inheriting from DelegatingHandler and overriding its Send and SendAsync methods, you can implement custom behaviors such as adding request headers, logging, authentication, error handling, and more.
Simply put, DelegatingHandler can be viewed as "middleware" that intercepts remote HTTP requests.