Home | History | Annotate | Download | only in protocol
      1 <html>
      2 <head>
      3 <!--
      4 /*
      5  * $HeadURL: http://svn.apache.org/repos/asf/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/protocol/package.html $
      6  * $Revision: 496070 $
      7  * $Date: 2007-01-14 04:18:34 -0800 (Sun, 14 Jan 2007) $
      8  *
      9  * ====================================================================
     10  * Licensed to the Apache Software Foundation (ASF) under one
     11  * or more contributor license agreements.  See the NOTICE file
     12  * distributed with this work for additional information
     13  * regarding copyright ownership.  The ASF licenses this file
     14  * to you under the Apache License, Version 2.0 (the
     15  * "License"); you may not use this file except in compliance
     16  * with the License.  You may obtain a copy of the License at
     17  *
     18  *   http://www.apache.org/licenses/LICENSE-2.0
     19  *
     20  * Unless required by applicable law or agreed to in writing,
     21  * software distributed under the License is distributed on an
     22  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
     23  * KIND, either express or implied.  See the License for the
     24  * specific language governing permissions and limitations
     25  * under the License.
     26  * ====================================================================
     27  *
     28  * This software consists of voluntary contributions made by many
     29  * individuals on behalf of the Apache Software Foundation.  For more
     30  * information on the Apache Software Foundation, please see
     31  * <http://www.apache.org/>.
     32  *
     33  */
     34 -->
     35 </head>
     36 <body>
     37 HTTP protocol execution framework.
     38 
     39 Apart from simply sending and receiving messages, there are a lot
     40 of things to consider when communicating with HTTP. Many details
     41 such as transport encodings or connection management are handled
     42 by setting up or interpreting
     43 {@link org.apache.http.Header headers} in the messages.
     44 In order to relieve applications from the responsibility of
     45 implementing these nitty-gritty details of the protocol,
     46 HTTP components provides an execution framework that sets up
     47 some of the headers before sending a message, and interprets
     48 headers when a message has been received.
     49 <br/>
     50 An HTTP {@link org.apache.http.protocol.HttpProcessor processor}
     51 typically keeps lists of so-called interceptors that will be executed
     52 before a message is sent and after it has been received.
     53 An application should initialize a processor, set up the lists
     54 with the required and desired processors, and then communicate
     55 through that processor. There are four kinds of interceptors,
     56 depending on whether they act on
     57 {@link org.apache.http.HttpRequestInterceptor requests} or
     58 {@link org.apache.http.HttpResponseInterceptor responses},
     59 on the client or server side:
     60 
     61 <table border="1" cellpadding="5">
     62 <tr><th></th>
     63     <th>Client</th>
     64     <th>Server</th>
     65 </tr>
     66 <tr><th>Request</th>
     67     <td>prepares headers before a request is sent</td>
     68     <td>interprets headers when a request is received</td>
     69 </tr>
     70 <tr><th>Response</th>
     71     <td>interprets headers when a response is received</td>
     72     <td>prepares headers before a response is sent</td>
     73 </tr>
     74 </table>
     75 
     76 <p>
     77 {@link org.apache.http.protocol.HttpRequestExecutor HttpRequestExecutor}
     78 is a processor for the client side,
     79 {@link org.apache.http.protocol.HttpService HttpService}
     80 for the server side.
     81 On the client side, a {@link org.apache.http.protocol.HttpContext context}
     82 is used to tie together a request, the response to it, and other data
     83 that might be associated with the request execution. It is passed to
     84 the request executor whenever needed.
     85 </p>
     86 
     87 <p>
     88 <font size="+1">
     89 <i>
     90 Information about required and recommended interceptors for the
     91 client side will be provided elsewhere. For the time being, please
     92 refer to the comments in the example applications or ask on
     93 one of the mailing lists.
     94 </i>
     95 </font>
     96 </p>
     97 
     98 <p>
     99 <b>Note:</b>
    100 If you want to develop a server-side application, we recommend that
    101 you implement your application as a servlet running in a servlet engine
    102 like <a href="http://tomcat.apache.org/">Tomcat</a> or full-blown
    103 JSEE container like <a href="http://geronimo.apache.org/">Geronimo</a>.
    104 If you prefer to implement a server-side application based on our
    105 {@link org.apache.http.protocol.HttpService HttpService}, we'll
    106 assume that you know what you're doing and that you don't need
    107 help in figuring out which interceptors need to be configured.
    108 </p>
    109 
    110 
    111 </body>
    112 </html>
    113