Differences Between Method GET and Method POST
Methods GET and POST both refer to how the browser sends information to a web page.
Most people don't need to know what method their browser uses when requesting data. Even as a site developer, it isn't often that a choice needs to be made between GET and POST methods.
Yet, when you do need to make a choice, it is good to know what it is you are choosing.
When links to a web page are tapped, they are method GET. Link URLs (and URLs typed into a browser's address bar) may send additional information to the destination web page through the use of URL parameters. URL parameters are a "?" character appended to the URL and followed by information.
Example URL with parameters.
http://example.com/page.php?name=will&state=awake
Generally, when a form is submitted, it contains information submitted with a form using method POST. Example form:
<form method="post" action="https://example.com"> Name: <input type="text" name="the_name"> <br><input type="submit" value="Tap me"> </form>
So, really, how are GET and POST different from each other?
A link GETs a web page, sometimes with information. A form POSTs to a web page, usually with information.
The entire URL of a GET request is logged in server logs. For POST requests, only the destination URL, not the form information, is logged in server logs.
(Server logs contain information about what goes on at the server. There is no way to bypass all server logs except by modifying the server software. Interactions with the server are noted, generally with the IP address.)
Method GET URLs are length-limited. The maximum length depends on server configuration. Almost always the server will accept at least 255 characters. Often 511 characters. Sometimes as many as 1023 characters.
Method POST generally allows at least 8 megabytes of information, frequently much more, perhaps 32 or even 64 megabytes.
Here is a table of GET and POST differences.
| Differences | ||
|---|---|---|
| Item | GET | POST |
| Data logged in server logs | Yes | No |
| Data visible in browser's address bar | Yes | No |
| General maximum amount of data | <=1k | >=8mg |
The above differences between method GET and method POST are the primary ones considered when a choice needs to be made.
(This content first appeared in Possibilities newsletter.)
Will Bontrager

