What it means
The request succeeded and there is no body to return. Headers may still carry metadata such as a new ETag.
Common causes
- A DELETE succeeded
- A PUT or PATCH saved changes without returning the resource
- A CORS preflight or beacon endpoint replied
How to fix it
As a client or visitor
Do not try to parse a body; calling response.json() on a 204 throws. Check the status before reading.
As the site or API owner
Never send a body with 204. Return 200 with JSON if clients need the updated resource.
Example response
HTTP/1.1
HTTP/1.1 204 No Content
Date: Tue, 07 Oct 2025 09:30:00 GMT
Server: nginx Specification
FAQ
› Why does response.json() fail on 204?
There is no body to parse. Check response.status === 204 (or content length) before calling json().
› Should DELETE return 204 or 200?
204 when there is nothing to report, 200 when you return a body such as the deleted item or a confirmation.