A successful DELETE request usually returns 204 No Content, meaning the resource was deleted and there is no content to send back.
If the resource does not exist, the server usually returns 404 Not Found to indicate the resource was not found.
DELETE is idempotent because sending the same DELETE request multiple times results in the same state as sending it once. After the first successful deletion, further DELETEs do nothing.
/api/items/123 but get a 405 error. What is the most likely cause?DELETE /api/items/123 HTTP/1.1 Host: example.com
A 405 Method Not Allowed means the server understands the request but does not allow DELETE on that URL. The endpoint likely only supports GET or POST.
Requiring a confirmation token or similar check in the DELETE request helps prevent accidental deletions by ensuring the client really intends to delete the resource.
