0167: http://www.a.com/pictures/index.htm
0168: GET /pictures/index.htm HTTP/1.1 0169: Host: www.a.com 0170: Content-Type: text/html 0171:
0172: HTTP/1.1 200 OK 0173: Date: Mon, 29 Mar 2004 14:40:58 GMT 0174: Server: Apache/1.3.27 (Unix) PHP/4.3.2 mod_ssl/2.8.12 OpenSSL/0.9.6g 0175: Last-Modified: Mon, 29 Mar 2004 14:37:27 GMT 0176: Accept-Ranges: bytes 0177: Content-Type: text/html; charset=iso-8859-1 0178: Content-Length: 31 0179: 0180: <html> 0181: <p> 0182: hello world! 0183: </p> 0184: </html>
Although most WWW pages are produced by means of an HTTP GET request, some WWW pages are the result of an HTTP POST request. HTTP POST requests often occur when you click on the submit button of a web form. For example, suppose a WWW page provides the following web form:
0185: <form method="POST" action="http://www.a.com/pictures/query.php"> 0186: <input type="text" name="last"/> 0187: <input type="text" name="first"/> 0188: <input type="text" name="age"/> 0189: <input type="submit" value="submit/> 0190: </form>Suppose the visitor to this WWW page types some values (say Bloggs, Fred and 27) into the three textboxes and then clicks the submit button. Because the form has a method attribute of "POST", an HTTP POST request will be generated:
0191: POST /pictures/query.php HTTP/1.1 0192: Host: www.a.com 0193: Content-Type: application/x-www-form-urlencoded 0194: Content-Length: XXXX 0195: 0196: last=Bloggs&first=Fred&age=27