语言

UrlRequest.ICallback.OnRedirectReceived 方法

定义

每当遇到重定向时调用。

[Android.Runtime.Register("onRedirectReceived", "(Landroid/net/http/UrlRequest;Landroid/net/http/UrlResponseInfo;Ljava/lang/String;)V", "GetOnRedirectReceived_Landroid_net_http_UrlRequest_Landroid_net_http_UrlResponseInfo_Ljava_lang_String_Handler:Android.Net.Http.UrlRequest/ICallbackInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=34)]
public void OnRedirectReceived(Android.Net.Http.UrlRequest request, Android.Net.Http.UrlResponseInfo info, string newLocationUrl);
[<Android.Runtime.Register("onRedirectReceived", "(Landroid/net/http/UrlRequest;Landroid/net/http/UrlResponseInfo;Ljava/lang/String;)V", "GetOnRedirectReceived_Landroid_net_http_UrlRequest_Landroid_net_http_UrlResponseInfo_Ljava_lang_String_Handler:Android.Net.Http.UrlRequest/ICallbackInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=34)>]
abstract member OnRedirectReceived : Android.Net.Http.UrlRequest * Android.Net.Http.UrlResponseInfo * string -> unit

参数

request
UrlRequest

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

info
UrlResponseInfo

响应信息。

newLocationUrl
String

重定向请求的位置。

特性

注解

每当遇到重定向时调用。 这只会在调用和UrlRequest#startCallback#onResponseStarted onResponseStarted()调用之间调用。 重定向响应的正文(如果有)将被忽略。

在调用 URLRequest UrlRequest#followRedirect 的方法(同步或异步)之前,不会跟踪重定向。

Java文档android.net.http.UrlRequest.Callback.onRedirectReceived(android.net.http.UrlRequest, android.net.http.UrlResponseInfo, java.lang.String)。

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

适用于