Restful way for deleting a bunch of items

后端 未结 8 1131
栀梦
栀梦 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 06:03

    As there is no 'proper' way to do this, what I have done in the past is:

    send DELETE to http://example.com/something with xml or json encoded data in the body.

    when you receive the request, check for DELETE, if true, then read the body for the ones to be deleted.

提交回复
热议问题