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

Definition

Sends an HTTP request to the inner handler to send to the server as an asynchronous operation.

protected public:
 override System::Threading::Tasks::Task<System::Net::Http::HttpResponseMessage ^> ^ SendAsync(System::Net::Http::HttpRequestMessage ^ request, System::Threading::CancellationToken cancellationToken);
protected internal override System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> SendAsync (System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken);
override this.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 to the server.

cancellationToken
CancellationToken CancellationToken CancellationToken

A cancellation token to cancel operation.

Returns

The task object representing the asynchronous operation.

Exceptions

Remarks

This operation does not block. This overridable implementation of SendAsync method forwards the HTTP request to the inner handler to send to the server as an asynchronous operation.

The SendAsync method is mainly used by the system and not by applications. When this method is called, it calls the SendAsync method on the inner handler.

Applies to