The HTTP Request
| A |
POST /info/services/website HTTP/1.0
Connection: Keep-Alive
User-Agent: Mozilla/4.76 [en] (X11; U; Linux 2.4.2-2 i586; Nav)
Host: www.cs.uchicago.edu
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*
Accept-Encoding: gzip
Accept-Language: en
Accept-Charset: iso-8859-1,*,utf-8
Cookie: cs_mode=edit; cs_login=bla2blahh15861cablah57dblah43blah
Content-type: multipart/form-data;
boundary=---------------------------62993215913904462331845589843
Content-Length: 296
-----------------------------62993215913904462331845589843
Content-Disposition: form-data; name="userid"
dustin
-----------------------------62993215913904462331845589843
Content-Disposition: form-data; name="passwd"
foobar
-----------------------------62993215913904462331845589843--
The portion in red is the method. This is generally either GET or POST, and this site uses the two literally: GET gets a page from the server, while POST sends new content to the server.
The next, orange portion is the path, sometimes also known as the URI. It specifies the document the browser would like to access. It is the part of the original URL which appears after the server's name. So the example request above corresponds to http://www.cs.uchicago.edu/info/services/website.
The third, green portion contains the request headers. These contain all sorts of extra data about the request. The most important headers above are Host, Cookie, and Content-type. The Host header corresponds to the server name in the URL. Apache uses the value in this header to determine exactly which server the browser thinks it's talking to, allowing a single Apache process to represent many server names, or virtual hosts. The Cookie header contains information from previous requests that the server has asked the browser to remember; the site uses this information to identify the current user and what mode she's in. Finally, the Content-type header identifies the format of the entity-body.
The fourth, blue section is the entity-body itself. GET requests don't have entity bodies, but POST requests like this one can be in one of two formats (differentiated by the Content-type header). The first, default, format is application/x-www-form-urlencoded, but the format shown here is multipart/form-data, and is required for doing file uploads and handling other complex forms.

