In the past two Gearhead columns, we began to explore the question: "How does a Web server application get data from a form?" This week, we'll wrap it up.
The first week we covered what goes on in an HTTP transaction, and last week we discussed the mechanism of a GET request:
GET /cgi-bin/myapp.pl?search= Gearhead%20columns&hits=10 HTTP/1.0User-Agent: xxxxxxAccept: image/gif, image/jpeg, */*But last week we made a mistake: The form we showed that was supposed to generate the above request was missing the ACTION (the program we want to run -- if you spotted this, award yourself a point). The form should have read:As we also mentioned last week, GET isn't the only mechanism by which data is passed to a Web server. This is good because the amount of data that can be passed by a GET request is limited by the size of the "environment" made available by the Web server's operating system.
To overcome this restriction, the POST method is available. To use it with the above form, the first line defining the form should read: