Top Description Fields Constructors Methods
org.apache.hc.client5.http.impl

public Class DefaultRedirectStrategy

extends Object
implements RedirectStrategy
Class Inheritance
All Implemented Interfaces
org.apache.hc.client5.http.protocol.RedirectStrategy
Annotations
@Contract
threading:STATELESS
Imports
java.net.URI, .URISyntaxException, java.util.Locale, org.apache.hc.client5.http.protocol.RedirectStrategy, org.apache.hc.client5.http.utils.URIUtils, org.apache.hc.core5.annotation.Contract, .ThreadingBehavior, org.apache.hc.core5.http.Header, .HttpException, .HttpHeaders, .HttpRequest, .HttpResponse, .HttpStatus, .ProtocolException, org.apache.hc.core5.http.protocol.HttpContext, org.apache.hc.core5.net.URIBuilder, org.apache.hc.core5.util.Args

Default implementation of RedirectStrategy.
Since
4.1

Field Summary

Modifier and TypeField and Description
public static final DefaultRedirectStrategy

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected URI
createLocationURI(final String location)

public URI
public boolean
isRedirected(final HttpRequest
the executed request
request
,
final HttpResponse
the response received from the target server
response
,
final HttpContext
the context for the request execution
context
)

Implements org.apache.hc.client5.http.protocol.RedirectStrategy.isRedirected.

Determines if a request should be redirected to a new location given the response from the target server.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

INSTANCEback to summary
public static final DefaultRedirectStrategy INSTANCE

Constructor Detail

DefaultRedirectStrategyback to summary
public DefaultRedirectStrategy()

Method Detail

createLocationURIback to summary
protected URI createLocationURI(final String location) throws ProtocolException
Since
4.1
getLocationURIback to summary
public URI getLocationURI(final HttpRequest request, final HttpResponse response, final HttpContext context) throws HttpException

Implements org.apache.hc.client5.http.protocol.RedirectStrategy.getLocationURI.

Annotations
@Override
isRedirectedback to summary
public boolean isRedirected(final HttpRequest request, final HttpResponse response, final HttpContext context) throws ProtocolException

Implements org.apache.hc.client5.http.protocol.RedirectStrategy.isRedirected.

Doc from org.apache.hc.client5.http.protocol.RedirectStrategy.isRedirected.

Determines if a request should be redirected to a new location given the response from the target server.

Parameters
request:HttpRequest

the executed request

response:HttpResponse

the response received from the target server

context:HttpContext

the context for the request execution

Returns:boolean

true if the request should be redirected, false otherwise

Annotations
@Override