2

I had asked a related below question and from answers, I got a sense of why is there a notion of methods like GET,POST etc in http protocol:

What is the need of methods like GET and POST in the HTTP protocol?

This raises another question like how does browser know which HTTP method like GET,POST etc to use?. For example in gmail compose link, the PUT/POST request and data will be sent. How does the browser come to know which method to use? Does the gmail page sent by server include the method name to use when calling gmail compose request URL? when we call www.gmail.com , it must be using GET method, how does the browser know that this method to use?

  • If you log in using this account, you will be able to comment here. You don't need reputation to comment on answers to your own question. You weren't able to comment on your other question because you created two accounts. You probably logged in using two different methods which creates different accounts. – Stephen Ostermiller Sep 20 at 10:50
  • @StephenOstermiller It might seem silly, but I am not able to locate how to sign out from the other account..don't see any option. – BioLogic Sep 20 at 11:00
  • There is a "log out" link in the "hamburger" menu that kind of looks like a speech bubble. See How to log out of a Stack Exchange site? – Stephen Ostermiller Sep 20 at 11:02
  • @StephenOstermiller : Want to follow through this hurdle. So am able to sign out now, but not able to find how did it pick the funny username user104656 used in another question. my fb/gmail/ uses this username BioLogic of this question. I tried with email/password as well. Since, I had forgotten password, I used email used with gmail,fb and tried resetting password. Even that led to BioLogic username. Don't know, how to get to the username used in another question. Thanks a lot for helping out. – BioLogic Sep 20 at 11:09
  • Please sign into either account, visit the contact form and select ‘I need to merge user profiles’. After you contact us, the Stack Exchange Team will reach out to verify that you own both accounts. If we can confirm your ownership, we will initiate a merge. (It needs a community manager who is a stack exchange employee to do that, I as a moderator can't do it.) – Stephen Ostermiller Sep 20 at 14:04
2

In short, context.

Type a keyword that isn't a URL into the browser's search bar? Send a GET request to the default search engine with that keyword.

Type a URL into the browser's search bar? Send a GET request to the URL itself.

Click on a normal link on a web page? Send a GET request to the URL as specified by the href tag of the link.

Click on a form button on a web page? Send a POST request to the URL that you are currently on.

Click on a button that is handled by some ajax? Whatever that ajax code specifies.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.