HTTP Method: Get vs. Post
- Use POST when form action should not be repeated; or when the action "changes the state"
- Use GET when form action is safely repeatable; when the action does not change the state.
The technical term for this is "idempotent".
get: form information sent from browser to server as part of query string, visible in the URL
- Query String
https://host/path?param1=value1¶m2=value2¶m3=value3
- Question mark
- Ampersand separated parameter/value pairs
- parameter=value
post: form information sent from browser to server as part of HTTP body; not in URL
Example
3.2 - Simple for using 'get' - Example 3.2
<form method="get" action="https://cs12.net/form/submit.php">Email Address:
<input type="text" name="email"/>
<br/>
<button type="submit">Submit </button>
</form>