A base type for HTTP message handlers.
Assembly: System.Net.Http (in System.Net.Http.dll)
Releases the unmanaged resources and disposes of the managed resources used by the.
Releases the unmanaged resources used by theand optionally disposes of the managed resources.
Determines whether the specified object is equal to the current object.(Inherited from Object.)
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)
Serves as the default hash function. (Inherited from Object.)
Send an HTTP request as an asynchronous operation.
Returns a string that represents the current object.(Inherited from Object.)
There are various HTTP message handles that can be used. These include the following.
DelegatingHandler - A class used to plug a handler into a handler chain.
- A simple to class to derive from that supports the most common requirements for most applications.
HttpClientHandler - A class that operates at the bottom of the handler chain that actually handles the HTTP transport operations.
WebRequestHandler - A specialty class that operates at the bottom of the handler chain class that handles HTTP transport operations with options that are specific to the System.Net.HttpWebRequest object.
This is necessary since methods on HttpClient can be called concurrently and need a guarantee of thread safety. So if a handler is assigned to an HttpClient instance, the SendAsync method of the handler may get called concurrently by the HttpClient instance and needs to be thread safe.
Available since 8
Available since 4.5
Portable Class Library
Supported in: portable .NET platforms
Available since 8.1
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.