Compartilhar via


IHttpClientAsyncLogger.LogRequestStartAsync Method

Definition

Logs before sending an HTTP request.

public System.Threading.Tasks.ValueTask<object?> LogRequestStartAsync (System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken = default);
abstract member LogRequestStartAsync : System.Net.Http.HttpRequestMessage * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<obj>
Public Function LogRequestStartAsync (request As HttpRequestMessage, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of Object)

Parameters

request
HttpRequestMessage

The HTTP request message that will be sent.

cancellationToken
CancellationToken

The cancellation token to cancel operation.

Returns

The task object representing the asynchronous operation. The result of the operation is a context object that will be passed to a corresponding LogRequestStopAsync(Object, HttpRequestMessage, HttpResponseMessage, TimeSpan, CancellationToken) or LogRequestFailedAsync(Object, HttpRequestMessage, HttpResponseMessage, Exception, TimeSpan, CancellationToken). Can be null if no context object is needed by the implementation.

Exceptions

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

Applies to