I have a set of elements, and some of them may or may not be deleted, depending on some preconditions. If the user wants to delete the resource ( DELETE /collection/1) and there are external dependencies on this resource, the server will return an error. But what should happen if the user wants to delete the entire collection ( DELETE /collection)?
DELETE /collection/1
DELETE /collection
If all resources that can be deleted are deleted and the server returns 2xx, or should the server leave everything unchanged and return 4xx? What will be the expected behavior?
REST API, , , , 409 Conflict , . , DELETE , @jbarrueta.
409 Conflict
, , , , , - 206 Partial Content ( DELETE, ) .
206 Partial Content
, , DELETE.
, - 409 - - ( ). .
, REST SOAP/RPC, . REST , HATEOAS, .
, DELETE /collection, , , . , - , , .
, "" , .
, , () , , GET.
, ( DELETE /collection/all DELETE/collection/),
DELETE /collection/all
DELETE/collection/
, delete , , , , , , - , , , . .
,
, DELETE URL-,
DELETE
- DELETE /collection/unused
DELETE /collection/unused
ALL - DELETE /collection/all