HttpClientHandler.SendAsync(HttpRequestMessage, CancellationToken) Method

Definition

Creates an instance of HttpResponseMessage based on the information provided in the HttpRequestMessage as an operation that will not block.

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

The HTTP request message.

cancellationToken
CancellationToken

A cancellation token to cancel the operation.

Returns

The task object representing the asynchronous operation.

Exceptions

The request was null.

Remarks

This operation is does not block. It returns an instance of Task<TResult> to represent the asynchronous operation. When the operation completes, Result contains the response message.

Applies to