A protocol handler that handles redirect status codes 301, 302, 303, 307 and 308.
| Modifier and Type | Field and Description |
|---|---|
| public static final String | |
| private final HttpRedirector |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | accept(Request
the request to accept request, Response the response to accept response)Implements org. Inspects the given |
| public String | getName()
Implements org. |
| public Response. | |
| public void | onComplete(Result
the result of the request / response exchange result)Overrides default org. |
| public boolean | onHeader(Response
the response containing the response line data and the headers so far response, HttpField the header received field)Overrides default org. |
| public void | onSuccess(Response
the response containing the response line data and the headers response)Overrides default org. |
| NAME | back to summary |
|---|---|
| public static final String NAME | |
| redirector | back to summary |
|---|---|
| private final HttpRedirector redirector | |
| RedirectProtocolHandler | back to summary |
|---|---|
| public RedirectProtocolHandler(HttpClient client) | |
| accept | back to summary |
|---|---|
| public boolean accept(Request request, Response response) Implements org. Doc from org. Inspects the given For example, a redirect protocol handler can inspect the response code and return true if it is a redirect response code. This method is being called just after the response line has been parsed, and before the response headers are available. | |
| getName | back to summary |
|---|---|
| public String getName() Implements org. Doc from org. Get a unique name among protocol handlers. | |
| getResponseListener | back to summary |
|---|---|
| public Response. Implements org.
| |
| onComplete | back to summary |
|---|---|
| public void onComplete(Result result) Overrides default org. Doc from org. Callback method invoked when the request and the response have been processed, either successfully or not.
The
Requests may complete after response, for example in case of big uploads that are
discarded or read asynchronously by the server.
This method is always invoked after | |
| onHeader | back to summary |
|---|---|
| public boolean onHeader(Response response, HttpField field) Overrides default org. Doc from org. Callback method invoked when a response header has been received and parsed, returning whether the header should be processed or not. | |
| onSuccess | back to summary |
|---|---|
| public void onSuccess(Response response) Overrides default org. Doc from org. Callback method invoked when the whole response has been successfully received. | |