RESTful delete strategy

后端 未结 5 433
走了就别回头了
走了就别回头了 2021-01-11 14:12

Let\'s say I have a resource that can have two different behaviors when delete is called

  1. The resource is deleted.
  2. The resource is moved to the recycl
5条回答
  •  难免孤独
    2021-01-11 15:06

    Your idea is fine, but I think a custom request header would be a little more appropriate. Query parameters are better suited to, well, parameters.

    A custom request header would look something like this:

    DELETE /myresource
    X-Really-Delete: Yup
    

提交回复
热议问题