DelegatingHandler::SendAsync Method (HttpRequestMessage^, CancellationToken)

.NET Framework (current version)
 

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

Namespace:   System.Net.Http
Assembly:  System.Net.Http (in System.Net.Http.dll)

public protected:
virtual Task<HttpResponseMessage^>^ SendAsync(
	HttpRequestMessage^ request,
	CancellationToken cancellationToken
) override

Parameters

request
Type: System.Net.Http::HttpRequestMessage^

The HTTP request message to send to the server.

cancellationToken
Type: System.Threading::CancellationToken

A cancellation token to cancel operation.

Return Value

Type: System.Threading.Tasks::Task<HttpResponseMessage^>^

The task object representing the asynchronous operation.

Exception Condition
ArgumentNullException

The request was null.

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.

Universal Windows Platform
Available since 8
.NET Framework
Available since 4.5
Portable Class Library
Supported in: portable .NET platforms
Windows Phone
Available since 8.1
Return to top
Show: