How should I choose between GET and POST methods in HTML forms?

后端 未结 17 1604
醉话见心
醉话见心 2020-11-27 18:42

I wish to know all the pros and cons about using these two methods. In particular the implications on web security.

Thanks.

17条回答
  •  长情又很酷
    2020-11-27 19:23

    GET passes data in the URL, POST passes the same data in the HTTP content, both are exactly the same from a security standpoint (that is, completely insecure unless you do something about it yourself, like using HTTPS).

    GET is limited by the maximum URL length supported by the browser and web server, so it can only be used in short forms.

    From an HTTP standard viewpoint GET requests should not change the site and browsers/ spiders are much more likely to make GET requests on their own (without the user actually clicking something) then POST requests.

提交回复
热议问题