HttpMessageHandler.Send(HttpRequestMessage, CancellationToken) 方法

定义

在派生类中被重写时,发送带有指定请求和取消标记的 HTTP 请求。 否则,将引发 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 请求消息。

cancellationToken
CancellationToken

取消操作的取消标记。

返回

HTTP 响应消息。

例外

此方法不会在派生类中被重写。

取消令牌已取消。 此异常存储在返回的任务中。

适用于