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

后端 未结 17 1618
醉话见心
醉话见心 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:12

    The Google search engine is an example of a GET form, because you should be able to search twice in a row and not affect the results by doing this. It also has the nice effect that you can link to a search results page, because it is a normal GET request, like any other address.

    As said previously, use POST for deleting or updating data, but I'd like to add that you should immediately redirect your user to a GET page.

    http://en.wikipedia.org/wiki/Post/Redirect/Get

提交回复
热议问题