Partager via


UrlRequest.ICallback.OnRedirectReceived Method

Definition

Invoked whenever a redirect is encountered.

[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

Parameters

request
UrlRequest

Request being redirected. <strong>This is not guaranteed to be the same object as the one received by other callbacks, nor is it guaranteed to be the one returned by URLRequest.Builder#build.</strong> However, method calls on this object will have the same effects as calls on the original URLRequest.

info
UrlResponseInfo

Response information.

newLocationUrl
String

Location where request is redirected.

Attributes

Remarks

Invoked whenever a redirect is encountered. This will only be invoked between the call to UrlRequest#start and Callback#onResponseStarted onResponseStarted(). The body of the redirect response, if it has one, will be ignored.

The redirect will not be followed until the URLRequest's UrlRequest#followRedirect method is called, either synchronously or asynchronously.

Java documentation for android.net.http.UrlRequest.Callback.onRedirectReceived(android.net.http.UrlRequest, android.net.http.UrlResponseInfo, java.lang.String).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to