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)

使用指定的 HttpMessageHandler 初始化 HttpMessageInvoker 类的实例。Initializes an instance of a HttpMessageInvoker class with a specific HttpMessageHandler.

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

使用指定的 HttpMessageHandler 初始化 HttpMessageInvoker 类的实例。Initializes an instance of a HttpMessageInvoker class with a specific HttpMessageHandler.

方法

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

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

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

释放由 HttpMessageInvoker 使用的非托管资源,并可根据需要释放托管资源。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 的浅表副本。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)

适用于