When should I use GET or POST method? What's t

2018-12-31 02:05发布

What's the difference when using GET or POST method? Which one is more secure? What are (dis)advantages of each of them?

(similar question)

14条回答
梦寄多情
2楼-- · 2018-12-31 02:41
  1. GET method is use to send the less sensitive data whereas POST method is use to send the sensitive data.
  2. Using the POST method you can send large amount of data compared to GET method.
  3. Data sent by GET method is visible in browser header bar whereas data send by POST method is invisible.
查看更多
只靠听说
3楼-- · 2018-12-31 02:41

Use GET method if you want to retrieve the resources from URL. You could always see the last page if you hit the back button of your browser, and it could be bookmarked, so it is not as secure as POST method.

Use POST method if you want to 'submit' something to the URL. For example you want to create a google account and you may need to fill in all the detailed information, then you hit 'submit' button (POST method is called here), once you submit successfully, and try to hit back button of your browser, you will get error or a new blank form, instead of last page with filled form.

查看更多
登录 后发表回答