共用方式為


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)之後經過的時間。

適用於