Form data may be sent to scripts for processing by using the GET method as well as the POST method.
POST and GET requests are very similar except that the values of the GET form variables are sent as part of the URL.
That is, the variable values are appended to the URL following a question mark (?), and special characters are escaped just as special characters in URLs must be escaped to assure interoperability. Hence the MIME type designation: application/x-www-form-urlencoded.
The server script can unpack the data shipped in the URL somewhat as it can unpack data sent via the POST method.
The ability to append data to an arbitrary URL makes it possible to construct HTML anchors that send data to server scripts when they are activated. This allows document creators to prepare "canned queries" within their documents, something that is not possible with the POST method. But POST is more secure as user can't see (and modify) form values.
Method |
Meaning |
GET |
Retrieve the information identified by the URL resource e.g. GET a particular Web page or image. The most common method by far.
|
POST |
Submit data to the Web server such as 1) post a message to a
bulletin board, newsgroup or mailing list, 2) provide input data -
typically from a CGI form - to a data-handling process, 3) add a
record directly to a database.
|
|