DelegatingHandler DelegatingHandler DelegatingHandler DelegatingHandler Class

定义

将 HTTP 响应消息的处理委托给另一处理程序(称为“内部处理程序”)的 HTTP 处理程序的类型。A type for HTTP handlers that delegate the processing of HTTP response messages to another handler, called the inner handler.

public ref class DelegatingHandler abstract : System::Net::Http::HttpMessageHandler
public abstract class DelegatingHandler : System.Net.Http.HttpMessageHandler
type DelegatingHandler = class
    inherit HttpMessageHandler
Public MustInherit Class DelegatingHandler
Inherits HttpMessageHandler
继承
DelegatingHandlerDelegatingHandlerDelegatingHandlerDelegatingHandler
派生

注解

应用程序应提供一个内部处理程序的构造函数中或通过InnerHandler属性之前调用SendAsync; 否则为InvalidOperationException将引发。An application should provide an inner handler either in the constructor or through the InnerHandler property before calling SendAsync; otherwise, an InvalidOperationException will be thrown.

请注意,InnerHandler属性可能也一个委派处理程序。Note that InnerHandler property may be a delegating handler as well. 此方法允许处理程序堆栈,以处理 HTTP 响应消息创建。This approach allows the creation of handler stacks to process the HTTP response messages.

构造函数

DelegatingHandler() DelegatingHandler() DelegatingHandler() DelegatingHandler()

创建 DelegatingHandler 类的新实例。Creates a new instance of the DelegatingHandler class.

DelegatingHandler(HttpMessageHandler) DelegatingHandler(HttpMessageHandler) DelegatingHandler(HttpMessageHandler) DelegatingHandler(HttpMessageHandler)

创建特定内部处理程序的 DelegatingHandler 类的新实例。Creates a new instance of the DelegatingHandler class with a specific inner handler.

属性

InnerHandler InnerHandler InnerHandler InnerHandler

获取或设置处理 HTTP 响应消息的内部处理程序。Gets or sets the inner handler which processes the HTTP response messages.

方法

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)

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

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)

异步发送 HTTP 请求到要发送到服务器的内部处理程序。Sends an HTTP request to the inner handler to send to the server as an asynchronous operation.

ToString() ToString() ToString() ToString()

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

(Inherited from Object)

适用于