Sdílet prostřednictvím


HttpClientHandler Class

A base class for HTTP handler implementations.

Inheritance Hierarchy

System.Object
  System.Net.Http.HttpMessageHandler
    System.Net.Http.HttpClientHandler

Namespace:  System.Net.Http
Assembly:  System.Net.Http (in System.Net.Http.dll)

Syntax

'Declaration
Public Class HttpClientHandler _
    Inherits HttpMessageHandler
'Usage
Dim instance As HttpClientHandler
public class HttpClientHandler : HttpMessageHandler
public ref class HttpClientHandler : public HttpMessageHandler
type HttpClientHandler =  
    class 
        inherit HttpMessageHandler 
    end
public class HttpClientHandler extends HttpMessageHandler

The HttpClientHandler type exposes the following members.

Constructors

  Name Description
Public method HttpClientHandler Creates an instance of a HttpClientHandler class.

Top

Properties

  Name Description
Public property AllowAutoRedirect Gets or sets a value that indicates whether the handler should follow redirection responses.
Public property AutomaticDecompression Gets or sets the type of decompression method used by the handler for automatic decompression of the HTTP content response.
Public property ClientCertificateOptions Gets or sets how the client certificates are provided.
Public property CookieContainer Gets or sets the cookie container used to store server cookies by the handler.
Public property Credentials Gets or sets authentication information used by this handler.
Public property MaxAutomaticRedirections Gets or sets the maximum number of redirects that the handler follows.
Public property MaxRequestContentBufferSize Gets or sets the maximum request content buffer size used by the handler.
Public property PreAuthenticate Gets or sets a value that indicates whether the handler sends an Authorization header with the request.
Public property Proxy Gets or sets proxy information used by the handler.
Public property SupportsAutomaticDecompression Gets a value that indicates whether the handler supports automatic response content decompression.
Public property SupportsProxy Gets a value that indicates whether the handler supports proxy settings.
Public property SupportsRedirectConfiguration Gets a value that indicates whether the handler supports configuration settings for the AllowAutoRedirect and MaxAutomaticRedirections properties.
Public property UseCookies Gets or sets a value that indicates whether the handler uses the CookieContainer property to store server cookies and uses these cookies when sending requests.
Public property UseDefaultCredentials Gets or sets a value that controls whether default credentials are sent with requests by the handler.
Public property UseProxy Gets or sets a value that indicates whether the handler uses a proxy for requests.

Top

Methods

  Name Description
Public method Dispose() Releases the unmanaged resources and disposes of the managed resources used by the HttpMessageHandler. (Inherited from HttpMessageHandler.)
Protected method Dispose(Boolean) Releases the unmanaged resources used by the HttpClientHandler and optionally disposes of the managed resources. (Overrides HttpMessageHandler.Dispose(Boolean).)
Public method Equals (Inherited from Object.)
Protected method Finalize (Inherited from Object.)
Public method GetHashCode (Inherited from Object.)
Public method GetType (Inherited from Object.)
Protected method MemberwiseClone (Inherited from Object.)
Protected method SendAsync Sends an HTTP request with a cancellation token as an asynchronous operation. (Overrides HttpMessageHandler.SendAsync(HttpRequestMessage, CancellationToken).)
Public method ToString (Inherited from Object.)

Top

Extension Methods

  Name Description
Public Extension Method SupportsAllowAutoRedirect Determines whether the HTTP client handler supports following redirection responses. (Defined by HttpClientHandlerExtensions.)
Public Extension Method SupportsPreAuthenticate Determines whether the HTTP client handler supports sending an authorization header with the request. (Defined by HttpClientHandlerExtensions.)
Public Extension Method SupportsProtocolVersion Determines whether the HTTP client handler supports protocol version with the request. (Defined by HttpClientHandlerExtensions.)
Public Extension Method SupportsTransferEncodingChunked Determines whether the HTTP client handler supports transfer encoding chunked. (Defined by HttpClientHandlerExtensions.)
Public Extension Method SupportsUseProxy Determines whether the HTTP client handler supports using a proxy for the request. (Defined by HttpClientHandlerExtensions.)

Top

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

System.Net.Http Namespace