How POST Works
HTTP GET accounts for 90%+ of normal web browsing. The browser sends a
small request for a document and the server sends an HTTP header
followed by the requested document, or perhaps an error message.
However, when you
fill out a form and click the submit button, the process is a little
different. In particular if the form uses the POST method, then the
browser not only sends the request line and the HTTP header. It also
sends the form data as the request body, separated from the header
with a blank line. Customarily browsers send
an x-www-form-urlencoded query string as the body of the request. A
typical POST form submission looks something like this:
POST /cartmgr.cgi HTTP/1.1
Host: www.irs.gov
User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:0.9.2)
Accept: application/xml, text/html;q=0.9, image/png, */*;q=0.1
Accept-Language: en, fr;q=0.50
Accept-Encoding: gzip,deflate,compress,identity
Accept-Charset: ISO-8859-1, utf-8;q=0.66, *;q=0.66
Keep-Alive: 300
Connection: keep-alive
Content-type: application/x-www-form-urlencoded
Content-Length: 264
action=DISPLAY_CART&template=cartmgr.cart_display.html.txt
&error_template=default_error.html.txt
&Show+me+my+cart=Show+me+my+cart&action=DISPLAY_DOC
&CreditCard=1234567898769876&CardHolder=Elliotte+Harold
&expiresMonth=07&expiresYear=2003&type=Visa
&template=cartmgr.redirect.html.txt




