top | item 39736009

(no title)

lentil | 1 year ago

The resource to be deleted should be identified in the URL, so there is no need to pass a body. This is the same for `GET`.

discuss

order

sibit|1 year ago

This is how I've used DELETE. Something like DELETE /users/{uniqueUserId}. In ~10 years of building CRUD apps I don't think I've ever sent a body or query params with a request.

dpkirchner|1 year ago

Some tools let you pass a parameter to indicate that you only want the request to take effect if the requested resource is in some specific state. For example, Google Cloud Storage uses headers to allow you to set preconditions that must be met before the action takes place. For DELETEs you can use this to say "delete this resource but only if its generation (sort of a timestamp) is exactly $foo", where $foo is the generation last known to the client.

https://cloud.google.com/storage/docs/request-preconditions

joshlemer|1 year ago

What about where you're not just deleting a single entity by id? Like, for instance where a user can bulk select multiple items and then choose to delete them all (like email for instance), or maybe deleting by criteria, like "delete all Entities created before time X"