WebRequestHandler WebRequestHandler WebRequestHandler WebRequestHandler Class


提供不可用于 Windows Store 应用程序或其他环境的特定以桌面的功能。Provides desktop-specific features not available to Windows Store apps or other environments.

public ref class WebRequestHandler : System::Net::Http::HttpClientHandler
public class WebRequestHandler : System.Net.Http.HttpClientHandler
type WebRequestHandler = class
    inherit HttpClientHandler
Public Class WebRequestHandler
Inherits HttpClientHandler


此类实现传输处理程序使用HttpWebRequest实例,以将 HTTP 请求发送到服务器。This class implements a transport handler using HttpWebRequest instances to send HTTP requests to servers.


WebRequestHandler() WebRequestHandler() WebRequestHandler() WebRequestHandler()

初始化 WebRequestHandler 类的新实例。Initializes a new instance of the WebRequestHandler class.


AllowAutoRedirect AllowAutoRedirect AllowAutoRedirect AllowAutoRedirect

获取或设置一个值,该值指示处理程序是否应跟随重定向响应。Gets or sets a value that indicates whether the handler should follow redirection responses.

(Inherited from HttpClientHandler)
AllowPipelining AllowPipelining AllowPipelining AllowPipelining

获取或设置一个值,该值指示是否通过管线将请求传输到 Internet 资源。Gets or sets a value that indicates whether to pipeline the request to the Internet resource.

AuthenticationLevel AuthenticationLevel AuthenticationLevel AuthenticationLevel

获取或设置指示用于此请求的身份验证和模拟的级别的值。Gets or sets a value indicating the level of authentication and impersonation used for this request.

AutomaticDecompression AutomaticDecompression AutomaticDecompression AutomaticDecompression

获取或设置处理程序用于自动解压缩 HTTP 内容响应的解压缩方法类型。Gets or sets the type of decompression method used by the handler for automatic decompression of the HTTP content response.

(Inherited from HttpClientHandler)
CachePolicy CachePolicy CachePolicy CachePolicy

获取或设置此请求的缓存策略。Gets or sets the cache policy for this request.

CheckCertificateRevocationList CheckCertificateRevocationList CheckCertificateRevocationList CheckCertificateRevocationList

获取或设置一个值,该值指示是否根据证书颁发机构吊销列表检查证书。Gets or sets a value that indicates whether the certificate is checked against the certificate authority revocation list.

(Inherited from HttpClientHandler)
ClientCertificateOptions ClientCertificateOptions ClientCertificateOptions ClientCertificateOptions

获取或设置一个值,该值指示是否从证书存储自动挑选证书,或者是否允许调用方通过特定的客户端证书。Gets or sets a value that indicates if the certificate is automatically picked from the certificate store or if the caller is allowed to pass in a specific client certificate.

(Inherited from HttpClientHandler)
ClientCertificates ClientCertificates ClientCertificates ClientCertificates

获取或设置与此请求关联的安全证书集合。Gets or sets the collection of security certificates that are associated with this request.

ContinueTimeout ContinueTimeout ContinueTimeout ContinueTimeout

获取或设置应用程序在上载数据前等待来自服务器的 100 连续的时间量(毫秒)。Gets or sets the amount of time, in milliseconds, the application will wait for 100-continue from the server before uploading data.

CookieContainer CookieContainer CookieContainer CookieContainer

获取或设置用于通过处理程序存储服务器 Cookie 的 Cookie 容器。Gets or sets the cookie container used to store server cookies by the handler.

(Inherited from HttpClientHandler)
Credentials Credentials Credentials Credentials

获取或设置此处理程序使用的身份验证信息。Gets or sets authentication information used by this handler.

(Inherited from HttpClientHandler)
DefaultProxyCredentials DefaultProxyCredentials DefaultProxyCredentials DefaultProxyCredentials

使用默认(系统)代理时,获取或设置要提交到默认代理服务器进行身份验证的凭据。When the default (system) proxy is being used, gets or sets the credentials to submit to the default proxy server for authentication. 只有在 UseProxy 设置为 trueProxy 设置为 null 时才使用默认代理。The default proxy is used only when UseProxy is set to true and Proxy is set to null.

(Inherited from HttpClientHandler)
ImpersonationLevel ImpersonationLevel ImpersonationLevel ImpersonationLevel

获取或设置当前请求的模拟级别。Gets or sets the impersonation level for the current request.

MaxAutomaticRedirections MaxAutomaticRedirections MaxAutomaticRedirections MaxAutomaticRedirections

获取或设置处理程序遵循的重定向的最大数目。Gets or sets the maximum number of redirects that the handler follows.

(Inherited from HttpClientHandler)
MaxConnectionsPerServer MaxConnectionsPerServer MaxConnectionsPerServer MaxConnectionsPerServer

获取或设置使用 HttpClient 对象发出请求时允许的最大并发连接数(每个服务器终结点)。Gets or sets the maximum number of concurrent connections (per server endpoint) allowed when making requests using an HttpClient object. 请注意,该限制针对每个服务器终结点,例如,值为 256 表示允许 256 个到 http://www.adatum.com/ 的并发连接,以及另外 256 个到 http://www.adventure-works.com/ 的并发连接。Note that the limit is per server endpoint, so for example a value of 256 would permit 256 concurrent connections to http://www.adatum.com/ and another 256 to http://www.adventure-works.com/.

(Inherited from HttpClientHandler)
MaxRequestContentBufferSize MaxRequestContentBufferSize MaxRequestContentBufferSize MaxRequestContentBufferSize

获取或设置处理程序使用的最大请求内容缓冲区大小。Gets or sets the maximum request content buffer size used by the handler.

(Inherited from HttpClientHandler)
MaxResponseHeadersLength MaxResponseHeadersLength MaxResponseHeadersLength MaxResponseHeadersLength

获取或设置响应标头允许的最大长度。Gets or sets the maximum allowed length of the response headers.

PreAuthenticate PreAuthenticate PreAuthenticate PreAuthenticate

获取或设置一个值,该值指示处理程序是否随请求发送授权标头。Gets or sets a value that indicates whether the handler sends an Authorization header with the request.

(Inherited from HttpClientHandler)
Properties Properties Properties Properties

获取 HttpClient 的自定义属性的可写字典(即地图)。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.

(Inherited from HttpClientHandler)
Proxy Proxy Proxy Proxy

获取或设置处理程序使用的代理信息。Gets or sets proxy information used by the handler.

(Inherited from HttpClientHandler)
ReadWriteTimeout ReadWriteTimeout ReadWriteTimeout ReadWriteTimeout

获取或设置写入请求或读取服务器中的相应时的超时(以毫秒为单位)。Gets or sets a time-out in milliseconds when writing a request to or reading a response from a server.

ServerCertificateCustomValidationCallback ServerCertificateCustomValidationCallback ServerCertificateCustomValidationCallback ServerCertificateCustomValidationCallback

获取或设置用于验证服务器证书的回调方法。Gets or sets a callback method to validate the server certificate.

(Inherited from HttpClientHandler)
ServerCertificateValidationCallback ServerCertificateValidationCallback ServerCertificateValidationCallback ServerCertificateValidationCallback

获取或设置用于验证服务器证书的回调方法。Gets or sets a callback method to validate the server certificate.

SslProtocols SslProtocols SslProtocols SslProtocols

获取或设置 HttpClientHandler 对象管理的 HttpClient 对象所用的 TLS/SSL 协议。Gets or sets the TLS/SSL protocol used by the HttpClient objects managed by the HttpClientHandler object.

(Inherited from HttpClientHandler)
SupportsAutomaticDecompression SupportsAutomaticDecompression SupportsAutomaticDecompression SupportsAutomaticDecompression

获取一个值,该值指示处理程序是否支持自动响应内容解压缩。Gets a value that indicates whether the handler supports automatic response content decompression.

(Inherited from HttpClientHandler)
SupportsProxy SupportsProxy SupportsProxy SupportsProxy

获取一个值,该值指示处理程序是否支持代理设置。Gets a value that indicates whether the handler supports proxy settings.

(Inherited from HttpClientHandler)
SupportsRedirectConfiguration SupportsRedirectConfiguration SupportsRedirectConfiguration SupportsRedirectConfiguration

获取一个值,该值表示处理程序是否支持 AllowAutoRedirectMaxAutomaticRedirections 属性的配置设置。Gets a value that indicates whether the handler supports configuration settings for the AllowAutoRedirect and MaxAutomaticRedirections properties.

(Inherited from HttpClientHandler)
UnsafeAuthenticatedConnectionSharing UnsafeAuthenticatedConnectionSharing UnsafeAuthenticatedConnectionSharing UnsafeAuthenticatedConnectionSharing

获取或设置一个值,该值指示是否允许经过高速 NTLM 身份验证的连接共享。Gets or sets a value that indicates whether to allow high-speed NTLM-authenticated connection sharing.

UseCookies UseCookies UseCookies UseCookies

获取或设置一个值,该值指示处理程序是否使用 CookieContainer 属性来存储服务器 Cookie 并在发送请求时使用这些 Cookie。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.

(Inherited from HttpClientHandler)
UseDefaultCredentials UseDefaultCredentials UseDefaultCredentials UseDefaultCredentials

获取或设置一个值,该值控制处理程序是否随请求一起发送默认凭据。Gets or sets a value that controls whether default credentials are sent with requests by the handler.

(Inherited from HttpClientHandler)
UseProxy UseProxy UseProxy UseProxy

获取或设置一个值,该值表示处理程序是否对请求使用代理。Gets or sets a value that indicates whether the handler uses a proxy for requests.

(Inherited from HttpClientHandler)


Dispose() Dispose() Dispose() Dispose()

释放由 HttpMessageHandler 使用的非托管资源和托管资源。Releases the unmanaged resources and disposes of the managed resources used by the HttpMessageHandler.

(Inherited from HttpMessageHandler)
Dispose(Boolean) Dispose(Boolean) Dispose(Boolean) Dispose(Boolean)

释放由 HttpClientHandler 使用的非托管资源,并可根据需要释放托管资源。Releases the unmanaged resources used by the HttpClientHandler and optionally disposes of the managed resources.

(Inherited from HttpClientHandler)
Equals(Object) Equals(Object) Equals(Object) Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

获取当前实例的 TypeGets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(Inherited from Object)
SendAsync(HttpRequestMessage, CancellationToken) SendAsync(HttpRequestMessage, CancellationToken) SendAsync(HttpRequestMessage, CancellationToken) SendAsync(HttpRequestMessage, CancellationToken)

基于作为不会阻止的操作在 HttpRequestMessage 中提供的信息创建 HttpResponseMessage 的实例。Creates an instance of HttpResponseMessage based on the information provided in the HttpRequestMessage as an operation that will not block.

(Inherited from HttpClientHandler)
ToString() ToString() ToString() ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(Inherited from Object)