Top Description Methods
org.apache.hc.client5.http.protocol

public Interface RedirectStrategy

Known Direct Implementers
org.apache.hc.client5.http.impl.DefaultRedirectStrategy
Annotations
@Contract
threading:STATELESS
Imports
java.net.URI, org.apache.hc.core5.annotation.Contract, .ThreadingBehavior, org.apache.hc.core5.http.HttpException, .HttpRequest, .HttpResponse, org.apache.hc.core5.http.protocol.HttpContext

A strategy for determining if an HTTP request should be redirected to a new location in response to an HTTP response received from the target server.

Implementations of this interface must be thread-safe. Access to shared data must be synchronized as methods of this interface may be executed from multiple threads.

Since
4.1

Method Summary

Modifier and TypeMethod and Description
public URI
getLocationURI(final HttpRequest request, final HttpResponse response, final HttpContext context)

public boolean

Returns:

true if the request should be redirected, false otherwise
isRedirected
(HttpRequest
the executed request
request
,
HttpResponse
the response received from the target server
response
,
HttpContext
the context for the request execution
context
)

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

Method Detail

getLocationURIback to summary
public URI getLocationURI(final HttpRequest request, final HttpResponse response, final HttpContext context) throws HttpException
isRedirectedback to summary
public boolean isRedirected(HttpRequest request, HttpResponse response, HttpContext context) throws HttpException

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