204 No Content
2xx Successful
RFC 9110
Success. Nothing to add.
What 204 No Content means {#what}
The request was successful but there’s no body to return. The response ends with the headers. Common for DELETE operations and updates where the client doesn’t need a response body.
When you’ll see a 204 {#when}
DELETE /resource/42— deleted, nothing to returnPUTorPATCHwhere the server doesn’t echo back the updated resource- Preflight CORS requests
When to use 204 {#use}
- Use for DELETE and update operations that don’t need to return data
- Never send a body with a 204 — it will be ignored