When implementing soft row deletion by setting its status to deleted
which method is appropriate?
Should it be DELETE
for we are not passing that row to GET
anymore or should it be PUT
for we are updating the row's status to deleted
?
Asked
Active
Viewed 53 times
0

banzsh
- 540
- 1
- 4
- 18
2 Answers
2
If from the perspective of the user, the resource is not accessible after 'soft deleting' it, (e.g.: you would return a 404), use DELETE
. If you can still GET
the object after, I don't think I would use DELETE
, but PUT
may be more appropriate.

Evert
- 93,428
- 18
- 118
- 189
0
Marking for deletion should be on the client side, only POST to the server when you do a proper delete.
If you want to contact the server and do another GET in the meantime - you should do the delete at that point. i.e. your GET should get the latest data, meaning the delete should be done before the GET.

Will
- 367
- 3
- 4