3 ms·
I typically do the following for DELETE requests: Look up the item in the database. If it does not exist, serve a 404. If it exists and would be otherwise ac
by byoung2 13y ago
I typically do the following for DELETE requests:
Look up the item in the database. If it does not exist, serve a 404.
If it exists and would be otherwise accessible (e.g. a GET would return 200), then I set a delete flag in the database, and serve a 204.
If it exists, but would not otherwise be accessible (e.g. a GET would return 404), I would serve a 404.
If it exists, but has a delete flag set in the database, I would serve a 410.