LoggingScopeHttpMessageHandler.SendAsync Method

Definition

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

protected override System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> SendAsync (System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken);

Parameters

request
HttpRequestMessage

The HTTP request message to send to the server.

cancellationToken
CancellationToken

A cancellation token to cancel operation.

Returns

The task object representing the asynchronous operation.

Exceptions

The cancellation token was canceled. This exception is stored into the returned task.

Remarks

Logs the request to and response from the sent HttpRequestMessage.

Applies to

מוצר גירסאות
.NET 6 (package-provided), 7 (package-provided), 8 (package-provided), 9 (package-provided)
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)