HttpClientHandler.SendAsync Method (HttpRequestMessage, CancellationToken)
.NET Framework (current version)
Creates an instance of HttpResponseMessage based on the information provided in the HttpRequestMessage as an operation that will not block.
Assembly: System.Net.Http (in System.Net.Http.dll)
Protected Friend Overrides Function SendAsync ( request As HttpRequestMessage, cancellationToken As CancellationToken ) As Task(Of HttpResponseMessage)
Parameters
- request
-
Type:
System.Net.Http.HttpRequestMessage
The HTTP request message.
- cancellationToken
-
Type:
System.Threading.CancellationToken
A cancellation token to cancel the operation.
Return Value
Type: System.Threading.Tasks.Task(Of HttpResponseMessage)The task object representing the asynchronous operation.
| Exception | Condition |
|---|---|
| ArgumentNullException | The request was null. |
This operation is does not block. It returns an instance of Task(Of TResult) to represent the asynchronous operation. When the operation completes, Result contains the response message.
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
Available since 8
.NET Framework
Available since 4.5
Portable Class Library
Supported in: portable .NET platforms
Windows Phone
Available since 8.1
Show: