204 No Content
Success with deliberately no response body — the correct answer for DELETE, many PUT/PATCH updates, and preflight-ish endpoints. The defining rule: a 204 response must not contain a body, and clients must not try to parse one.
What usually causes it
- Successful DELETE or update where returning the entity is pointless
- Beacon/analytics endpoints acknowledging a fire-and-forget POST
How to debug and fix it
- If your client throws 'unexpected end of JSON input' after a delete, it is calling response.json() on a 204 — check status before parsing.
- If a 204 arrives with a body anyway, the server is violating the spec; some proxies will truncate or reject it.
- Prefer 204 over 200-with-empty-body: it is explicit, slightly cheaper, and unambiguous for caches.
Easily confused with
Debugging an API? Build and inspect requests, check response headers, or read the full status-code debugging guide.