Sobes.tech
Middle+

What HTTP status code is returned on a successful DELETE? And what if you try to delete an already deleted resource again?

sobes.tech AI

Answer from AI

When a resource is successfully deleted via HTTP DELETE, it usually returns a status code 204 No Content — indicating that the request was successful and the response body is empty.

If you try to delete a resource that has already been deleted or does not exist, the possible responses are:

  • 404 Not Found — if the server reports that the resource is not found.
  • 204 No Content — some APIs consider delete operations idempotent and return 204 even if the resource is already absent.

The idea is that DELETE should be idempotent: repeated calls should not result in an error, so both 204 and 404 are acceptable, but 204 is often recommended for client convenience.

What HTTP status code is returned on a successful… - sobes.tech