public class

DefaultRedirectStrategy

extends Object
implements RedirectStrategy
java.lang.Object
   ↳ org.apache.http.impl.client.DefaultRedirectStrategy

Class Overview

Default implementation of RedirectStrategy.

Summary

Constants
String REDIRECT_LOCATIONS
Public Constructors
DefaultRedirectStrategy()
Public Methods
URI getLocationURI(HttpRequest request, HttpResponse response, HttpContext context)
HttpUriRequest getRedirect(HttpRequest request, HttpResponse response, HttpContext context)
Determines the redirect location given the response from the target server and the current request execution context and generates a new request to be sent to the location.
boolean isRedirected(HttpRequest request, HttpResponse response, HttpContext context)
Determines if a request should be redirected to a new location given the response from the target server.
Protected Methods
URI createLocationURI(String location)
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.apache.http.client.RedirectStrategy

Constants

public static final String REDIRECT_LOCATIONS

Also: HttpClient

Constant Value: "http.protocol.redirect-locations"

Public Constructors

public DefaultRedirectStrategy ()

Also: HttpClient

Public Methods

public URI getLocationURI (HttpRequest request, HttpResponse response, HttpContext context)

Also: HttpClient

public HttpUriRequest getRedirect (HttpRequest request, HttpResponse response, HttpContext context)

Also: HttpClient

Determines the redirect location given the response from the target server and the current request execution context and generates a new request to be sent to the location.

Parameters
request the executed request
response the response received from the target server
context the context for the request execution
Returns
  • redirected request

public boolean isRedirected (HttpRequest request, HttpResponse response, HttpContext context)

Also: HttpClient

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

Parameters
request the executed request
response the response received from the target server
context the context for the request execution
Returns
  • true if the request should be redirected, false otherwise

Protected Methods

protected URI createLocationURI (String location)

Also: HttpClient