語言

HttpService.HandleException(HttpException, IHttpResponse) 方法

定義

從 HTTP 例外類型設定錯誤回應狀態,並將異常訊息作為 ASCII 文字實體使用。

[Android.Runtime.Register("handleException", "(Lorg/apache/http/HttpException;Lorg/apache/http/HttpResponse;)V", "GetHandleException_Lorg_apache_http_HttpException_Lorg_apache_http_HttpResponse_Handler")]
protected virtual void HandleException(Org.Apache.Http.HttpException? ex, Org.Apache.Http.IHttpResponse? response);
[<Android.Runtime.Register("handleException", "(Lorg/apache/http/HttpException;Lorg/apache/http/HttpResponse;)V", "GetHandleException_Lorg_apache_http_HttpException_Lorg_apache_http_HttpResponse_Handler")>]
abstract member HandleException : Org.Apache.Http.HttpException * Org.Apache.Http.IHttpResponse -> unit
override this.HandleException : Org.Apache.Http.HttpException * Org.Apache.Http.IHttpResponse -> unit

參數

ex
HttpException

映射回應狀態的 HTTP 例外:不支援的方法為 501,HTTP 版本為 505,協定錯誤為 400,其他 HTTP 例外為 500。

response
IHttpResponse

回應的狀態和實體被替換。 該實體以 US-ASCII 明文字形式包含例外訊息。

屬性

備註

此頁面的部分是根據 Android 開放原始碼專案所建立和共用的工作進行修改,並根據 Creative Commons 2.5 屬性授權中所述的詞彙使用。

適用於