HttpRequestExecutor is a client side HTTP protocol handler based
on the blocking (classic) I/O model.
HttpRequestExecutor relies on HttpProcessor to generate
mandatory protocol headers for all outgoing messages and apply common,
cross-cutting message transformations to all incoming and outgoing messages.
Application specific processing can be implemented outside
HttpRequestExecutor once the request has been executed and
a response has been received.
| Modifier and Type | Field and Description |
|---|---|
| public static final int | |
| private final int |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected boolean | canResponseHaveBody(final HttpRequest
the request, to obtain the executed method request, final HttpResponse the response, to obtain the status code response)Decide whether a response comes with an entity. |
| private static void | |
| protected HttpResponse | Returns: the terminal response, not yet post-processedthe request for which to obtain the response request, final HttpClientConnection the connection over which the request was sent conn, final HttpContext the context for receiving the response context)Waits for and receives a response. |
| protected HttpResponse | Returns: a terminal response received as part of an expect-continue handshake, ornull if the expect-continue handshake is not usedthe request to send, already
request, final HttpClientConnection preprocessedthe connection over which to send the request,
already established conn, final HttpContext the context for sending the request context)Send the given request over the given connection. |
| public HttpResponse | Returns: the response to the request.the request to execute. request, final HttpClientConnection the connection over which to execute the request. conn, final HttpContext context)Sends the request and obtain a response. |
| public void | postProcess(final HttpResponse
the response object to post-process response, final HttpProcessor the processor to use processor, final HttpContext the context for post-processing the response context)Post-processes the given response using the given protocol processor and completes the process of request execution. |
| public void | preProcess(final HttpRequest
the request to prepare request, final HttpProcessor the processor to use processor, final HttpContext the context for sending the request context)Pre-process the given request using the given protocol processor and initiates the process of request execution. |
| DEFAULT_WAIT_FOR_CONTINUE | back to summary |
|---|---|
| public static final int DEFAULT_WAIT_FOR_CONTINUE | |
| waitForContinue | back to summary |
|---|---|
| private final int waitForContinue | |
| HttpRequestExecutor | back to summary |
|---|---|
| public HttpRequestExecutor(final int waitForContinue) Creates new instance of HttpRequestExecutor.
| |
| HttpRequestExecutor | back to summary |
|---|---|
| public HttpRequestExecutor() | |
| canResponseHaveBody | back to summary |
|---|---|
| protected boolean canResponseHaveBody(final HttpRequest request, final HttpResponse response) Decide whether a response comes with an entity. The implementation in this class is based on RFC 2616. Derived executors can override this method to handle methods and response codes not specified in RFC 2616.
| |
| closeConnection | back to summary |
|---|---|
| private static void closeConnection(final HttpClientConnection conn) | |
| doReceiveResponse | back to summary |
|---|---|
| protected HttpResponse doReceiveResponse(final HttpRequest request, final HttpClientConnection conn, final HttpContext context) throws HttpException, IOException Waits for and receives a response. This method will automatically ignore intermediate responses with status code 1xx.
| |
| doSendRequest | back to summary |
|---|---|
| protected HttpResponse doSendRequest(final HttpRequest request, final HttpClientConnection conn, final HttpContext context) throws IOException, HttpException Send the given request over the given connection. This method also handles the expect-continue handshake if necessary. If it does not have to handle an expect-continue handshake, it will not use the connection for reading or anything else that depends on data coming in over the connection.
| |
| execute | back to summary |
|---|---|
| public HttpResponse execute(final HttpRequest request, final HttpClientConnection conn, final HttpContext context) throws IOException, HttpException Sends the request and obtain a response.
| |
| postProcess | back to summary |
|---|---|
| public void postProcess(final HttpResponse response, final HttpProcessor processor, final HttpContext context) throws HttpException, IOException Post-processes the given response using the given protocol processor and completes the process of request execution.
This method does not read the response entity, if any.
The connection over which content of the response entity is being
streamed from cannot be reused until
| |
| preProcess | back to summary |
|---|---|
| public void preProcess(final HttpRequest request, final HttpProcessor processor, final HttpContext context) throws HttpException, IOException Pre-process the given request using the given protocol processor and initiates the process of request execution.
| |