Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
class System.​Net.​Http.​SocketsHttpHandler
Assembly: System.Net.Http
Inheritance: object → HttpMessageHandler → SocketsHttpHandler
Implemented Interfaces
- IDisposable Implemented by: HttpMessageHandler
Provides the default message handler used by <see cref="T:System.Net.Http.HttpClient" /> in .NET Core 2.1 and later.
Properties
ActivityHeadersPropagator
Gets or sets the propagator to use when propagating the distributed trace and context.
Use <see langword="null" /> to disable propagation.
public
bool
AllowAutoRedirect
Gets or sets a value that indicates whether the handler should follow redirection responses.
public
DecompressionMethods
AutomaticDecompression
Gets or sets the type of decompression method used by the handler for automatic decompression of the HTTP content response.
public
Func<​SocketsHttpConnectionContext, Threading.​CancellationToken, Threading.​Tasks.​ValueTask<​IO.​Stream>>
ConnectCallback
Gets or sets a custom callback used to open new connections.
public
TimeSpan
ConnectTimeout
Gets or sets the timespan to wait before the connection establishing times out.
public
CookieContainer
CookieContainer
Gets or sets the managed cookie container object.
public
ICredentials
Credentials
Gets or sets authentication information used by this handler.
public
ICredentials
DefaultProxyCredentials
When the default (system) proxy is used, gets or sets the credentials used to submit to the default proxy server for authentication.
public
bool
EnableMultipleHttp2Connections
Gets or sets a value that indicates whether additional HTTP/2 connections can be established to the same server.
public
bool
EnableMultipleHttp3Connections
Gets or sets a value that indicates whether additional HTTP/3 connections can be established to the same server.
public
TimeSpan
Expect100ContinueTimeout
Gets or sets the time-out value for server HTTP 100 Continue response.
public
int
InitialHttp2StreamWindowSize
Defines the initial HTTP2 stream receive window size for all connections opened by the this <see cref="T:System.Net.Http.SocketsHttpHandler" /> .
public static
bool
IsSupported
Gets a value that indicates whether the handler is supported on the current platform.
public
TimeSpan
KeepAlivePingDelay
Gets or sets the keep alive ping delay.
public
HttpKeepAlivePingPolicy
KeepAlivePingPolicy
Gets or sets the keep alive ping behaviour.
public
TimeSpan
KeepAlivePingTimeout
Gets or sets the keep alive ping timeout.
public
int
MaxAutomaticRedirections
Gets or sets the maximum number of allowed HTTP redirects.
public
int
MaxConnectionsPerServer
Gets or sets the maximum number of simultaneous TCP connections allowed to a single server.
public
int
MaxResponseDrainSize
Gets or sets the maximum amount of data that can be drained from responses in bytes.
public
int
MaxResponseHeadersLength
Gets or sets the maximum length, in kilobytes (1024 bytes), of the response headers.
MeterFactory
Gets or sets the <see cref="T:System.Diagnostics.Metrics.IMeterFactory" /> to create a custom <see cref="T:System.Diagnostics.Metrics.Meter" /> for the <see cref="T:System.Net.Http.SocketsHttpHandler" /> instance.
public
Func<​SocketsHttpPlaintextStreamFilterContext, Threading.​CancellationToken, Threading.​Tasks.​ValueTask<​IO.​Stream>>
PlaintextStreamFilter
Gets or sets a custom callback that provides access to the plaintext HTTP protocol stream.
public
TimeSpan
PooledConnectionIdleTimeout
Gets or sets how long a connection can be idle in the pool to be considered reusable.
public
TimeSpan
PooledConnectionLifetime
Gets or sets how long a connection can be in the pool to be considered reusable.
public
bool
PreAuthenticate
Gets or sets a value that indicates whether the handler sends an Authorization header with the request.
public
Collections.​Generic.​IDictionary<​string, object>
Properties
Gets a writable dictionary (that is, a map) of custom properties for the HttpClient requests. The dictionary is initialized empty; you can insert and query key-value pairs for your custom handlers and special processing.
public
IWebProxy
Proxy
Gets or sets the custom proxy when the <see cref="P:System.Net.Http.SocketsHttpHandler.UseProxy" /> property is <see langword="true" /> .
public
HeaderEncodingSelector<​HttpRequestMessage>
RequestHeaderEncodingSelector
Gets or sets a callback that selects the <see cref="System.Text.Encoding" /> to encode request header values.
public
TimeSpan
ResponseDrainTimeout
Gets or sets the timespan to wait for data to be drained from responses.
public
HeaderEncodingSelector<​HttpRequestMessage>
ResponseHeaderEncodingSelector
Gets or sets a callback that selects the <see cref="System.Text.Encoding" /> to decode response header values.
SslOptions
Gets or sets the set of options used for client TLS authentication.
public
bool
UseCookies
Gets or sets a value that indicates whether the handler should use cookies.
public
bool
UseProxy
Gets or sets a value that indicates whether the handler should use a proxy.
Methods
protected
void
Dispose​(bool disposing)
public
void
Dispose​()
Inherited from HttpMessageHandler
Releases the unmanaged resources and disposes of the managed resources used by the <see cref="T:System.Net.Http.HttpMessageHandler" /> .
public
bool
Equals​(object obj)
Inherited from object
protected
void
Finalize​()
Inherited from object
public
int
GetHashCode​()
Inherited from object
protected
object
MemberwiseClone​()
Inherited from object
public
string
ToString​()
Inherited from object