Lesson 14 / 28

Form Basics

The form tag, action and method attributes.

The form tag

action is where the data is sent; method is how — get (in the URL) or post (in the request body).

<form action="/submit" method="post">
  <input type="text" name="username">
  <button type="submit">Send</button>
</form>

GET vs POST

Use get for searches/filters (visible, bookmarkable URL); use post for anything sensitive or that changes data.