An approach to deleting multiple resources use one DELETE
- Hi all,
How about doing this in the following way:
1. use PUT to create a composite resource that contains all the
resource that are going to be deleted at the "same" time. Of course,
the server side should know the purpose of this PUT, and return the
URI of the created composite resource.
2. use DELETE to delete the composite resource.
In this way, both the client side and the server side have clear
understanding of what each operation and each URI mean.
I feel it is more explicit and clear than sending a POST with many "delete".
- Eric -
Here is how I see it. I think (hope) others also see it this way.
The web defines the architecture of a global hypertext system. [*]
The web is defined by a number of RFCs (HTTP 1/1, URI generic syntax,
etc.) and other specs.
Roy Fielding’s dissertation defines an architectural style, REST.
(Here I get hazy because I have not studied this sort of thing
The web, as defined in these RFCs, (generally) conforms to the
constraints laid out in Roy Fielding’s dissertation.
In other words:
REST (architectural style)
> the web (architecture)REST defines the general constraints that the web conforms to. The web
> your web app (the implementation)
defines the way things actually get done.
For instance, REST says you should have a uniform interface. The web
defines a uniform interface.
If you accept this model of the web, and I do, the things that you are
saying about DELETE don’t make much sense.
* These statements are general; there are certainly problematic edge
cases where HTTP does not, in fact, align with the REST style.