HTTP Protocol : The Request


An HTTP request includes:

- A request line
this line specifies the requested document, the method and the protocol version which are used. This three elements must be separated by a space.

- The request header fields
This fields are optional. They allow to send more information about the request or the client. (Navigator, OS...).

Header name Description
Accept Content accepted by the browser (example : text/html).
Accept-Charset Charset accepted by the browser
Accept-Encoding Data encoding accepted by the browser
Accept-Language Language accepted by the browser
Authorization Identification of the user to the server
Content-Encoding Encoding type of the request body
Content-Language Language of the request body
Content-Length Length of the request body
Content-Type Content-Type of the request body (example : text/html)
Date Date of the beginning to the data transfer
Forwarded Used by intermediate machines between browser and server
From allow to specify the client e-mail
Link link between two URLs
Orig-URL Original URL of the request
User-Agent Client informations about name and version of the navigator and the OS.

- The body request
Optional lines which allow to send data with, for example, the POST method.


To summarize, this is the form of an HTTP request :
METHOD URL VERSION
HEADER : Value
EMPTY LINE
REQUEST BODY

And here is an example of an HTTP request :
GET http://www.eaeeie.org HTTP/1.1
Accept : text/html
User-Agent : Mozilla/4.0 (compatible; MSIE 5.0; Windows 95)
Empty line