Deleting a resource using http DELETE

后端 未结 4 604
孤独总比滥情好
孤独总比滥情好 2020-12-04 07:26

So, given that the DELETE verb in Http is idempotent, when I issue the following request, what should happen the second (or third, or fourth, etc...)?

DELETE         


        
4条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-04 07:44

    The RESTful web services cookbook is a great resource for this. By chance, its google preview show the page about DELETE (page 11):

    The DELETE method is idempotent. This implies that the server must return response code 200 (OK) even if the server deleted the resource in a previous request. But in practice, implementing DELETE as an idempotent operation requires the server to keep track of all deleted resources. Otherwise, it can return a 404 (Not Found).

提交回复
热议问题