public static interface

HttpRequest.RedirectHandler

chan.http.HttpRequest.RedirectHandler

Class Overview

Redirection handler interface.

See also:

Summary

Nested Classes
enum HttpRequest.RedirectHandler.Action

Redirection handler result. 

Fields
public static final HttpRequest.RedirectHandler BROWSER

HttpRequest.RedirectHandler implementation.

public static final HttpRequest.RedirectHandler NONE

HttpRequest.RedirectHandler implementation.

public static final HttpRequest.RedirectHandler STRICT

HttpRequest.RedirectHandler implementation.

Public Methods
abstract HttpRequest.RedirectHandler.Action onRedirectReached(int responseCode, Uri requestedUri, Uri redirectedUri, HttpHolder holder)

HTTP client will call this method every time it reaches redirect response code.

Fields

public static final HttpRequest.RedirectHandler BROWSER

HttpRequest.RedirectHandler implementation. This handler will follow all redirects with GET method.

public static final HttpRequest.RedirectHandler NONE

HttpRequest.RedirectHandler implementation. This handler will not follow any redirects.

public static final HttpRequest.RedirectHandler STRICT

HttpRequest.RedirectHandler implementation. This handler will follow 301 and 302 redirects with previous method. The rest will be followed with GET method.

Public Methods

public abstract HttpRequest.RedirectHandler.Action onRedirectReached (int responseCode, Uri requestedUri, Uri redirectedUri, HttpHolder holder)

HTTP client will call this method every time it reaches redirect response code. You must return the most suitable HttpRequest.RedirectHandler.Action type for this response.

Parameters
responseCode int: Response code.
requestedUri Uri: Requested URI.
redirectedUri Uri: URI decoded from Location header.
holder HttpHolder: HTTP holder instance.
Returns
HttpRequest.RedirectHandler.Action HttpRequest.RedirectHandler.Action type.
Throws
HttpException if HTTP exception occurred.