Reputation: 29
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
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