@Contract(threading=STATELESS) public class DefaultRedirectStrategy extends Object implements RedirectStrategy
RedirectStrategy. This strategy honors the restrictions
on automatic redirection of unsafe methods such as POST, PUT and DELETE imposed by
the HTTP specification. Non safe methods will be redirected as GET in response to
status code HttpStatus.SC_MOVED_PERMANENTLY, HttpStatus.SC_MOVED_TEMPORARILY
and HttpStatus.SC_SEE_OTHER.| Modifier and Type | Field and Description |
|---|---|
static DefaultRedirectStrategy |
INSTANCE |
| Constructor and Description |
|---|
DefaultRedirectStrategy() |
| Modifier and Type | Method and Description |
|---|---|
protected URI |
createLocationURI(String location) |
URI |
getLocationURI(org.apache.hc.core5.http.HttpRequest request,
org.apache.hc.core5.http.HttpResponse response,
org.apache.hc.core5.http.protocol.HttpContext context) |
boolean |
isRedirected(org.apache.hc.core5.http.HttpRequest request,
org.apache.hc.core5.http.HttpResponse response,
org.apache.hc.core5.http.protocol.HttpContext context)
Determines if a request should be redirected to a new location
given the response from the target server.
|
public static final DefaultRedirectStrategy INSTANCE
public boolean isRedirected(org.apache.hc.core5.http.HttpRequest request,
org.apache.hc.core5.http.HttpResponse response,
org.apache.hc.core5.http.protocol.HttpContext context)
throws org.apache.hc.core5.http.ProtocolException
RedirectStrategyisRedirected in interface RedirectStrategyrequest - the executed requestresponse - the response received from the target servercontext - the context for the request executiontrue if the request should be redirected, false
otherwiseorg.apache.hc.core5.http.ProtocolExceptionpublic URI getLocationURI(org.apache.hc.core5.http.HttpRequest request, org.apache.hc.core5.http.HttpResponse response, org.apache.hc.core5.http.protocol.HttpContext context) throws org.apache.hc.core5.http.HttpException
getLocationURI in interface RedirectStrategyorg.apache.hc.core5.http.HttpExceptionCopyright © 1999–2018 The Apache Software Foundation. All rights reserved.