MessageProcessingHandler MessageProcessingHandler MessageProcessingHandler MessageProcessingHandler Class

定義

處理常式的基底型別,這些處理常式僅對要求和 (或) 回應訊息執行一些小型處理。A base type for handlers which only do some small processing of request and/or response messages.

public ref class MessageProcessingHandler abstract : System::Net::Http::DelegatingHandler
public abstract class MessageProcessingHandler : System.Net.Http.DelegatingHandler
type MessageProcessingHandler = class
    inherit DelegatingHandler
Public MustInherit Class MessageProcessingHandler
Inherits DelegatingHandler
繼承

備註

回應訊息的實際建立會委派給內部處理常式。The actual creation of response messages is delegated to an inner handler. 如果處理常式不需要非同步作業,這會很有用,因為對要求和回應訊息的作業會快速。MessageProcessingHandlerThe MessageProcessingHandler is useful if the handler doesn't require asynchronous operations, because operations on request and response messages are fast.

最常見的用法是衍生自這個類別, 並覆寫ProcessRequestProcessResponse方法。The most common usage is to derive from this class and override the ProcessRequest and ProcessResponse methods.

建構函式

MessageProcessingHandler() MessageProcessingHandler() MessageProcessingHandler() MessageProcessingHandler()

建立 MessageProcessingHandler 類別的執行個體。Creates an instance of a MessageProcessingHandler class.

MessageProcessingHandler(HttpMessageHandler) MessageProcessingHandler(HttpMessageHandler) MessageProcessingHandler(HttpMessageHandler) MessageProcessingHandler(HttpMessageHandler)

使用特定的內部處理常式,建立 MessageProcessingHandler 類別的執行個體。Creates an instance of a MessageProcessingHandler class with a specific inner handler.

方法

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

釋放 Unmanaged 資源,並處置 HttpMessageHandler 所使用的 Managed 資源。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 所使用的 Unmanaged 資源,並選擇性處置 Managed 資源。Releases the unmanaged resources used by the DelegatingHandler, and optionally disposes of the managed resources.

(Inherited from DelegatingHandler)
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 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

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

針對傳送到伺服器的每個要求執行處理。Performs processing on each request sent to the server.

ProcessResponse(HttpResponseMessage, CancellationToken) ProcessResponse(HttpResponseMessage, CancellationToken) ProcessResponse(HttpResponseMessage, CancellationToken) ProcessResponse(HttpResponseMessage, CancellationToken)

針對來自伺服器的每個回應進行處理。Perform processing on each response from the server.

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)

屬性

InnerHandler InnerHandler InnerHandler InnerHandler

取得或設定處理 HTTP 回應訊息的內部處理常式。Gets or sets the inner handler which processes the HTTP response messages.

(Inherited from DelegatingHandler)

適用於