Why use two step approach to deleting multiple items with REST

后端 未结 3 830
广开言路
广开言路 2021-01-31 17:05

We all know the \'standard\' way of deleting a single item via REST is to send a single DELETE request to a URI example.com/Items/666. Grand, let\'s move on to dele

3条回答
  •  隐瞒了意图╮
    2021-01-31 17:39

    IMO:

    HTTP DELETE on existing collection to delete all of its member seems fine. Creating the collection just to delete all of the member sounds odd. As you yourself suggest, just pass IDs of the to be deleted items using JSON (or any other payload format). I think that the server should try to make multiple deletes an internal transaction though.

提交回复
热议问题