Forum Moderators: DixonJones
You find the RFC here:
ftp://ftp.isi.edu/in-notes/rfc2616.txt
and other information here:
[w3.org...]
Each of HEAD, GET and POST are ways of sending or requesting information from a web-server. There are other requests in HTTP, such as DELETE and PUT.
GET is a normal request for a resource, which is returned as a header and a body. The header contains protocol information and the body the actual resource, usually a HTML document or an image, but it can be any kind of file. The type of the file is included in the header.
HEAD is just like GET, but the body of the response is not sent, only the header. It can be used to inspect the type of a resource, its size, the last modification date, etc...
POST is a variant of GET, with slightly changed semantics. The protocol specifications state that a client (browser/bot/...) can assume that a request via GET doesn't change anything important on the server, such as sumitting an order or payment. Requests with side effects, i.e., that change the world in a way that is potentially significant to the user, have to be made with POST. That is why the browser will often warn you if your try to reload a page from a POST request. It might duplicate the side effect of the request, like ordering or paying twice.
A practical reason for using POST is for reqeusts that require a large amount of input data. With GET input data is encoded into the URI after a '?', but an URI often has an upper limit on the length, depending both on the client and the server. With POST input parameters are sent as a 'request body' that can have any size.
As you might have deduced, in HTTP both requests and responses are made up of a protocol header and the request/response body. GET sends an empty request body, while POST sends users data in the request body.
Anyway, this is just scratching the surface of HTTP, so you might want to read more in the resources indicated at the beginning of this post.
René.