204 No Content
Success with no response body (common for DELETE or PUT).
Common causes
- A DELETE / PUT succeeded with nothing to return
- A CORS preflight (OPTIONS) returns an empty response
How to fix
- Do not send a body with 204 – browsers and proxies ignore it
- Clients must not call JSON.parse on the empty body
Detailed reference (MDN) ↗RFC 9110 §15.3.5 ↗
Which code should I use?
- 200 / 201 / 204: 200: success with content. 201: a new resource was created (with Location). 204: success with no body (common for DELETE / PUT).
