## 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&param2=value2&param3=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 11.2 - Simple for using 'get' - Example 11.2
<form method="get" action="https://cs12.net/form/submit.php" enctype="application/x-www-form-urlencoded"> Email Address:<input type="text" name="email"/><button type="submit"> Submit </button></form>

- Markup
- Display

     <form method="get" action="https://cs12.net/form/submit.php">Email Address:
       <input type="text" name="email"/>

       <button type="submit">Submit   </button>
     </form>

Example 11.3 - Simple form using 'post' - Example 11.3
<form method="post" action="https://cs12.net/form/submit.php" enctype="application/x-www-form-urlencoded"> Email Address:<input type="text" name="email"/><button type="submit">Submit</button></form>

- Markup
- Display

     <form method="post" action="https://cs12.net/form/submit.php">Email Address:
       <input type="text" name="email"/>

       <button type="submit">Submit   </button>
     </form>