MessageProcessingHandler::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 sealed

Parameters

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

The HTTP request message to send to the server.

cancellationToken
Type: System.Threading::CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

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.

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: