GET vs. POST Best Practices

后端 未结 10 2090
南方客
南方客 2020-11-27 19:44

For my web application (PHP/MYSQL), I show a list of items and a link on each row to delete the item. Right now, the link is



        
10条回答
  •  离开以前
    2020-11-27 20:26

    Here's a good example of why not to use GET to change server state:

    http://www.infoworld.com/article/08/06/16/25FE-stupid-users-part-3-admins_5.html

    The key portion is:

    "It logged into the administrative area and followed the 'delete' link for every entry," the admin says.

    If the delete had been coded as a POST this never would have happened. (OTOH we'd be robbed of a funny sysadmin story.)

提交回复
热议问题