IHttpClientAsyncLogger.LogRequestFailedAsync Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Logs the exception happened while sending an HTTP request.
public System.Threading.Tasks.ValueTask LogRequestFailedAsync (object? context, System.Net.Http.HttpRequestMessage request, System.Net.Http.HttpResponseMessage? response, Exception exception, TimeSpan elapsed, System.Threading.CancellationToken cancellationToken = default);
abstract member LogRequestFailedAsync : obj * System.Net.Http.HttpRequestMessage * System.Net.Http.HttpResponseMessage * Exception * TimeSpan * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask
Public Function LogRequestFailedAsync (context As Object, request As HttpRequestMessage, response As HttpResponseMessage, exception As Exception, elapsed As TimeSpan, Optional cancellationToken As CancellationToken = Nothing) As ValueTask
- context
- Object
The context object that was previously returned by LogRequestStartAsync(HttpRequestMessage, CancellationToken).
- request
- HttpRequestMessage
The HTTP request message that was sent.
- response
- HttpResponseMessage
If available, the HTTP response message that was received, and null
otherwise.
- exception
- Exception
Exception that happened during processing the HTTP request.
- elapsed
- TimeSpan
Time elapsed since calling LogRequestStartAsync(HttpRequestMessage, CancellationToken).
- cancellationToken
- CancellationToken
The cancellation token to cancel operation.
The task object representing the asynchronous operation.
The cancellation token was canceled. This exception is stored into the returned task.
Produkt | Versions |
---|---|
.NET | 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) |
.NET feedback
.NET er et åben kildekode projekt. Vælg et link for at give feedback: