A protocol handler performs HTTP protocol operations on behalf of the application, typically like a browser would.
A typical example is handling HTTP redirects. HttpClient
could just return the redirect response to the application,
but the application would have to implement the redirect
functionality (while browsers do this automatically).
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| public String | |
| public Response. | getResponseListener()
Returns: a response listener that will handle the request and response on behalf of the application. |
| accept | back to summary |
|---|---|
| public boolean accept(Request request, Response response) 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() Get a unique name among protocol handlers.
| |
| getResponseListener | back to summary |
|---|---|
| public Response. | |