Home » HttpComponents-Core-4.0.1 » org.apache.http.protocol » [javadoc | source]
org.apache.http.protocol
public class: HttpRequestExecutor [javadoc | source]
java.lang.Object
   org.apache.http.protocol.HttpRequestExecutor
HttpRequestExecutor is a client side HTTP protocol handler based on the blocking I/O model that implements the essential requirements of the HTTP protocol for the client side message processing, as described by RFC 2616.
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.
Constructor:
 public HttpRequestExecutor() 
Method from org.apache.http.protocol.HttpRequestExecutor Summary:
canResponseHaveBody,   doReceiveResponse,   doSendRequest,   execute,   postProcess,   preProcess
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.http.protocol.HttpRequestExecutor Detail:
 protected boolean canResponseHaveBody(HttpRequest request,
    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.
 protected HttpResponse doReceiveResponse(HttpRequest request,
    HttpClientConnection conn,
    HttpContext context) throws HttpException, IOException 
    Waits for and receives a response. This method will automatically ignore intermediate responses with status code 1xx.
 protected HttpResponse doSendRequest(HttpRequest request,
    HttpClientConnection conn,
    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.

 public HttpResponse execute(HttpRequest request,
    HttpClientConnection conn,
    HttpContext context) throws IOException, HttpException 
    Sends the request and obtain a response.
 public  void postProcess(HttpResponse response,
    HttpProcessor processor,
    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 HttpEntity#consumeContent() has been invoked.

 public  void preProcess(HttpRequest request,
    HttpProcessor processor,
    HttpContext context) throws HttpException, IOException 
    Pre-process the given request using the given protocol processor and initiates the process of request execution.