@Contract(threading=STATELESS) public class DefaultRedirectStrategy extends Object implements RedirectStrategy
RedirectStrategy
.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
RedirectStrategy
isRedirected
in interface RedirectStrategy
request
- 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.ProtocolException
public 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 RedirectStrategy
org.apache.hc.core5.http.HttpException
Copyright © 1999–2021 The Apache Software Foundation. All rights reserved.