HttpMessageHandler.SendAsync(HttpRequestMessage, CancellationToken) HttpMessageHandler.SendAsync(HttpRequestMessage, CancellationToken) HttpMessageHandler.SendAsync(HttpRequestMessage, CancellationToken) Method

Definition

Send an HTTP request as an asynchronous operation.

protected public:
 abstract System::Threading::Tasks::Task<System::Net::Http::HttpResponseMessage ^> ^ SendAsync(System::Net::Http::HttpRequestMessage ^ request, System::Threading::CancellationToken cancellationToken);
protected internal abstract System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> SendAsync (System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken);
abstract member SendAsync : System.Net.Http.HttpRequestMessage * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage>
Parameters
request
HttpRequestMessage HttpRequestMessage HttpRequestMessage

The HTTP request message to send.

cancellationToken
CancellationToken CancellationToken CancellationToken

The cancellation token to cancel operation.

Returns

The task object representing the asynchronous operation.

Exceptions

Remarks

This operation will not block. The returned Task<TResult> object will complete once the entire response including content is read.

The SendAsync method is used primarily by the system. This method is called by the system one of the HttpClient.SendAsync methods is called. Most apps will never call this method.

Applies to