public final class NeverFollowRedirectCallback extends java.lang.Object implements OnRedirectCallback
OnRedirectCallback implementation that doesn't follow any redirects. To get an instance use getInstance().| Modifier and Type | Method and Description |
|---|---|
boolean |
followRedirect(HttpStatus status,
java.net.URI redirectingLocation,
java.net.URI newLocation)
This is called when a server has sent some sort of redirect.
|
static NeverFollowRedirectCallback |
getInstance()
Returns an instance of
NeverFollowRedirectCallback. |
public static NeverFollowRedirectCallback getInstance()
NeverFollowRedirectCallback.NeverFollowRedirectCallback.public boolean followRedirect(HttpStatus status, java.net.URI redirectingLocation, java.net.URI newLocation)
OnRedirectCallbackRedirectionException is thrown by the HttpRequestExecutor.followRedirect in interface OnRedirectCallbackstatus - One of HttpStatus.MOVED_PERMANENTLY, HttpStatus.FOUND, HttpStatus.SEE_OTHER, HttpStatus.TEMPORARY_REDIRECT or
HttpStatus.PERMANENT_REDIRECT.redirectingLocation - The absolute URI of the resource that returned the redirect.newLocation - The absolute URI that was returned by the server as the new location.true to follow that redirect and resent the request to the new location, false to not follow it and throw a
RedirectionException instead.