IHttpClientLogger.LogRequestFailed 方法

定义

记录发送 HTTP 请求时发生的异常。

public:
 void LogRequestFailed(System::Object ^ context, System::Net::Http::HttpRequestMessage ^ request, System::Net::Http::HttpResponseMessage ^ response, Exception ^ exception, TimeSpan elapsed);
public void LogRequestFailed (object? context, System.Net.Http.HttpRequestMessage request, System.Net.Http.HttpResponseMessage? response, Exception exception, TimeSpan elapsed);
abstract member LogRequestFailed : obj * System.Net.Http.HttpRequestMessage * System.Net.Http.HttpResponseMessage * Exception * TimeSpan -> unit
Public Sub LogRequestFailed (context As Object, request As HttpRequestMessage, response As HttpResponseMessage, exception As Exception, elapsed As TimeSpan)

参数

context
Object

以前由 返回的 LogRequestStart(HttpRequestMessage)上下文对象。

request
HttpRequestMessage

已发送的 HTTP 请求消息。

response
HttpResponseMessage

如果可用,则为收到的 HTTP 响应消息, null 否则为 。

exception
Exception

处理 HTTP 请求期间发生的异常。

elapsed
TimeSpan

自调用 LogRequestStart(HttpRequestMessage)以来经过的时间。

适用于