HttpMessageHandler.Send(HttpRequestMessage, CancellationToken) 方法

定义

在派生类中被重写时,发送带有指定请求和取消标记的 HTTP 请求。When overridden in a derived class, sends an HTTP request with the specified request and cancellation token. 否则,将引发 NotSupportedExceptionOtherwise, throws a NotSupportedException.

protected public:
 virtual System::Net::Http::HttpResponseMessage ^ Send(System::Net::Http::HttpRequestMessage ^ request, System::Threading::CancellationToken cancellationToken);
protected internal virtual System.Net.Http.HttpResponseMessage Send (System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken);
abstract member Send : System.Net.Http.HttpRequestMessage * System.Threading.CancellationToken -> System.Net.Http.HttpResponseMessage
override this.Send : System.Net.Http.HttpRequestMessage * System.Threading.CancellationToken -> System.Net.Http.HttpResponseMessage
Protected Friend Overridable Function Send (request As HttpRequestMessage, cancellationToken As CancellationToken) As HttpResponseMessage

参数

request
HttpRequestMessage

要发送的 HTTP 请求消息。The HTTP request message to send.

cancellationToken
CancellationToken

取消操作的取消标记。The cancellation token to cancel operation.

返回

HttpResponseMessage

HTTP 响应消息。The HTTP response message.

例外

此方法不会在派生类中被重写。The method is not overridden in the derived class.

适用于