HttpMessageInvoker HttpMessageInvoker HttpMessageInvoker HttpMessageInvoker Class

定義

特定類別,允許應用程式呼叫 HTTP 處理常式鏈結的 SendAsync(HttpRequestMessage, CancellationToken) 方法。A specialty class that allows applications to call the SendAsync(HttpRequestMessage, CancellationToken) method on an HTTP handler chain.

public ref class HttpMessageInvoker : IDisposable
public class HttpMessageInvoker : IDisposable
type HttpMessageInvoker = class
    interface IDisposable
Public Class HttpMessageInvoker
Implements IDisposable
繼承
HttpMessageInvokerHttpMessageInvokerHttpMessageInvokerHttpMessageInvoker
衍生
實作

備註

這個類別是基底類型HttpClient和其他訊息發送者。This class is the base type for HttpClient and other message originators.

要連接到網站的大部分應用程式會使用其中一種SendAsync上的方法HttpClient類別。Most applications that are connecting to a web site will use one of the SendAsync methods on the HttpClient class.

建構函式

HttpMessageInvoker(HttpMessageHandler) HttpMessageInvoker(HttpMessageHandler) HttpMessageInvoker(HttpMessageHandler) HttpMessageInvoker(HttpMessageHandler)

使用特定 HttpMessageInvoker,初始化 HttpMessageHandler 類別的執行個體。Initializes an instance of a HttpMessageInvoker class with a specific HttpMessageHandler.

HttpMessageInvoker(HttpMessageHandler, Boolean) HttpMessageInvoker(HttpMessageHandler, Boolean) HttpMessageInvoker(HttpMessageHandler, Boolean) HttpMessageInvoker(HttpMessageHandler, Boolean)

使用特定 HttpMessageInvoker,初始化 HttpMessageHandler 類別的執行個體。Initializes an instance of a HttpMessageInvoker class with a specific HttpMessageHandler.

方法

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

釋放 Unmanaged 資源,並處置 HttpMessageInvoker 所使用的 Managed 資源。Releases the unmanaged resources and disposes of the managed resources used by the HttpMessageInvoker.

Dispose(Boolean) Dispose(Boolean) Dispose(Boolean) Dispose(Boolean)

釋放 HttpMessageInvoker 所使用的 Unmanaged 資源,並選擇性處置 Managed 資源。Releases the unmanaged resources used by the HttpMessageInvoker 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 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

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

以非同步作業的方式,傳送 HTTP 要求。Send an HTTP request as an asynchronous operation.

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

傳回代表目前物件的字串。Returns a string that represents the current object.

(Inherited from Object)

適用於