Justin Kindrix
Justin Kindrix

Reputation: 29

In an HTML form input, why is the method called GET if data is being "sent/submitted"?

I read on SoloLearn that the method attribute of an input tag within a form can be set to GET or POST. If both methods are sending data to another location, is an HTTP GET being used somehow? I thought GET was used to retrieve data, not send it. Can anyone help me understand, please?

Upvotes: 0

Views: 110

Answers (1)

Quentin
Quentin

Reputation: 943578

All HTTP requests involve sending something to the server.

A GET request is designed to be used to ask for something.

If you GET http://example.com/ then you ask for the root document for that site.

If you submit the form at https://duckduckgo.com/ then your request is to GET https://duckduckgo.com/?q=example&t=hf&ia=web. You are asking for the search results for the keyword "example".

Upvotes: 1

Related Questions