语言

UrlRequest.ICallback.OnFailed 方法

定义

如果请求因任何原因在之后 UrlRequest#start失败,则调用 。

[Android.Runtime.Register("onFailed", "(Landroid/net/http/UrlRequest;Landroid/net/http/UrlResponseInfo;Landroid/net/http/HttpException;)V", "GetOnFailed_Landroid_net_http_UrlRequest_Landroid_net_http_UrlResponseInfo_Landroid_net_http_HttpException_Handler:Android.Net.Http.UrlRequest/ICallbackInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=34)]
public void OnFailed(Android.Net.Http.UrlRequest request, Android.Net.Http.UrlResponseInfo? info, Android.Net.Http.HttpException error);
[<Android.Runtime.Register("onFailed", "(Landroid/net/http/UrlRequest;Landroid/net/http/UrlResponseInfo;Landroid/net/http/HttpException;)V", "GetOnFailed_Landroid_net_http_UrlRequest_Landroid_net_http_UrlResponseInfo_Landroid_net_http_HttpException_Handler:Android.Net.Http.UrlRequest/ICallbackInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=34)>]
abstract member OnFailed : Android.Net.Http.UrlRequest * Android.Net.Http.UrlResponseInfo * Android.Net.Http.HttpException -> unit

参数

request
UrlRequest

失败的请求。 <strong>这不能保证与其他回调接收的对象相同,也不保证是返回的对象 URLRequest.Builder#build。</strong> 但是,对此对象的方法调用将具有与对原始 URLRequest对象的调用相同的效果。

info
UrlResponseInfo

响应信息。 可能是 null 未收到任何响应。

error
HttpException

有关错误的信息。

特性

注解

如果请求因任何原因在之后 UrlRequest#start失败,则调用 。 调用后,不会调用其他 Callback 方法。 error 提供有关失败的信息。

Java文档android.net.http.UrlRequest.Callback.onFailed(android.net.http.UrlRequest, android.net.http.UrlResponseInfo, android.net.http.HttpException)。

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于