Where a form sends its data in HTML
Two methods, and the difference shows up in the address bar.
<form action="/search" method="get">
<label for="q">Search</label>
<input type="search" id="q" name="q">
<button>Search</button>
</form>
<form action="/orders" method="post"
enctype="multipart/form-data">
<label for="receipt">Receipt</label>
<input type="file" id="receipt" name="receipt">
<button>Upload</button>
</form>
How it works
GETputs the fields in the query string: shareable, bookmarkable.POSTputs them in the body: use it whenever the request changes something.enctypeonly matters for POST, and file uploads need the multipart one.
The run, in numbers
- Lines
- 12
- Characters to type
- 322
- Tokens
- 91
- Three-star pace
- 65 tpm
At the three-star pace of 65 tokens a minute, this run takes about 84 seconds.
Step 2 of 3 in A form, step 2 of 25 in Forms & inputs.