From what I can gather, there are three categories:
- Never use
GETand usePOST - Never use
POSTand useGET - It doesn’t matter which one you use.
Am I correct in assuming those three cases? If so, what are some examples from each case?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use
POSTfor destructive actions such as creation (I’m aware of the irony), editing, and deletion, because you can’t hit aPOSTaction in the address bar of your browser. UseGETwhen it’s safe to allow a person to call an action. So a URL like:Should bring you to a confirmation page, rather than simply deleting the item. It’s far easier to avoid accidents this way.
POSTis also more secure thanGET, because you aren’t sticking information into a URL. And so usingGETas themethodfor an HTML form that collects a password or other sensitive information is not the best idea.One final note:
POSTcan transmit a larger amount of information thanGET. ‘POST’ has no size restrictions for transmitted data, whilst ‘GET’ is limited to 2048 characters.