Twitter 已弃用所有使用 DELETE 作为请求方法的方法,
DELETE :user/lists/:id
现在改为使用 POST 作为请求方法,
POST lists/destroy
为什么 Twitter 在他们的 API 中完全停止使用 DELETE,而现在所有方法只使用 POST 和 GET?
构建一个只使用 POST 和 GET 的 API?
最佳答案
我认为某些客户端存在兼容性问题,无法发出 DELETE
要求。回顾docs对于其中一个已弃用的电话,我发现了这个简介。
Usage Note: clients who can not issue
DELETE
requests canPOST
with the added parameter_method=DELETE
所以,我的感觉(和猜测)是因为
DELETE
动词没有得到统一支持,它在系统范围内被删除。更新:我在 Twitter 上给 Taylor ( @episod ) 发了一条推文,询问他对上述内容的看法,他回复如下:
@arcain [the answer] pretty much covers it; no disrespect intended to idyllic REST. DELETE still usually works on those methods, but we omit from docs. [link]
@arcain though most of the methods mentioned there weren't deprecated because of the HTTP method so much as because of clumsy URL patterns. [link]
因此,可用性——连同兼容性——似乎是弃用的关键问题。
关于api - 为什么 Twitter 不赞成在他们的 API 中使用 DELETE 作为请求方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8841188/