What is a get request?

A GET request is an HTTP request that asks a server for something, such as a page, with any parameters carried in the address and not in a body.

GET is the method a browser uses when you follow a link or type an address. It is meant to read, not to change anything, so browsers and caches feel free to repeat it, store the result and keep the address in history. Parameters go in the query string after a question mark.

A form with no method attribute uses GET. On submit, the browser puts every field into the address, as in /search?q=shoes. That is right for a search or filter form, because the result can be bookmarked and shared. It is wrong for a contact form: the message ends up in the address bar and history, and file inputs cannot send their files.

Form backends receive submissions by POST. If a form that should send a message reloads the page with the fields in the address, it is missing method="POST".

http
GET /search?q=shoes&size=42 HTTP/1.1
Host: example.com

Related