Restful way for deleting a bunch of items

后端 未结 8 1107
栀梦
栀梦 2020-12-04 05:26

In wiki article for REST it is indicated that if you use http://example.com/resources DELETE, that means you are deleting the entire collection.

If you use http://ex

8条回答
  •  温柔的废话
    2020-12-04 05:51

    I would say DELETE http://example.com/resources/id1,id2,id3,id4 or DELETE http://example.com/resources/id1+id2+id3+id4. As "REST is an architecture (...) [not] protocol" to quote this wikipedia article there is, I believe, no single one way of doing this.

    I am aware that above is not possible without JS with HTML but I get the feeling that REST was:

    • Created without thinking of minor details like transactions. Who would need to operate on more then single item? This is somehow justified in HTTP protocol as it was not intended to serve through it anything else other then static webpages.
    • Not necessary well adjusting into current models - even of pure HTML.

提交回复
热议问题