RedirectStrategy

public abstract class RedirectStrategy


Defines a redirect strategy for the Cronet OkHttp transport layer.

Summary

Public methods

static RedirectStrategy

Returns a strategy which will follow redirects up to DEFAULT_REDIRECTS times.

static RedirectStrategy

Returns a strategy which will not follow redirects.

Public methods

defaultStrategy

public static RedirectStrategy defaultStrategy()

Returns a strategy which will follow redirects up to DEFAULT_REDIRECTS times. If more redirects are attempted an exception is thrown.

withoutRedirects

public static RedirectStrategy withoutRedirects()

Returns a strategy which will not follow redirects.

Note that because of Cronet's limitations (https://developer.android.com/guide/topics/connectivity/cronet/lifecycle#overview) it is impossible to retrieve the body of a redirect response. As a result, a dummy empty body will always be provided.