GET或POST删除 [英] GET or POST for deletion
问题描述
作为Web开发领域的新手,我有一些关于Web设计的一般性问题,这里是其中之一.
As a newbie in the world of web development, I have a handful of general questions regarding web design and here is one of them.
我正在为我的网站实现一个简单的通讯录.它应该允许用户添加/修改/删除地址.对于删除,我不清楚应如何实现.我应该使用GET还是POST将所需的删除信息传递到服务器?
I am working on implementing a simple address book for my web site. It should allow users to add/modify/delete address. For delete, I am not clear on how I should implement it. Should I use GET or POST to pass the required info for deletion to the server?
我认为使用POST进行删除更加安全,但是当Amazon的实现似乎可以解决该问题时(如下).我对采用哪种方法感到困惑,或者甚至有关系吗?
I thought it was more secured to use POST for deletion, but when Amazon's implementation seems to counter that (below). I am kind of confused on which approach to take, or does it even matter?
Amazon的地址删除方法
http://www.amazon.com/gp/css/account/address/view.html?ie=UTF8&addressID=xxxxx&addressDelete=true&sessionId=xxx-xxxxxxx-xxxxxxx
注意:这是用于网站(不是Web服务)
Note: This is for a web site (not a web service)
推荐答案
是RESTful Web服务还是只是从浏览器访问的网站?
Is it RESTful web service or just a web site accessed from the browser?
- 对于RESTFul服务,DELETE将是适当的
- 对于网站,只需POST.
这篇关于GET或POST删除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!