HTTP 204 — No Content
HTTP 204
No Content
The request succeeded and there is deliberately no body to send back.
What 204 actually means
Success with nothing to say. The classic use is DELETE: the resource is gone, there is nothing sensible to return, so the server sends 204 and stops. It is also common for PUT and PATCH where the client already knows the new state, and for endpoints whose only job is a side effect. A 204 must not have a body — sending one is a protocol violation and some clients will choke on it.
Common causes
- A DELETE completed successfully
- A PUT or PATCH saved changes and the server has nothing to add
- A beacon, analytics ping or preference-save endpoint acknowledged the request
If you're just trying to view the page
- Nothing — the action worked; a blank response here is correct, not a broken page
- If the interface still shows the old state, reload — the server saved the change but the page did not refresh
If it's your site
- Never send a response body with a 204; clients that follow the spec will not read it and some will error
- If the client needs the updated object back, return 200 with the body instead
- Watch for front-end code calling `response.json()` on a 204 — that throws, and it is a very common bug
Reference
- Status code
- 204
- Reason phrase
- No Content
- Category
- 2xx — Success
- Cacheable by default
- Yes
- Defined in
- RFC 9110 §15.3.5
Common questions
- What does HTTP 204 mean?
- The request succeeded and there is deliberately no body to send back. Success with nothing to say. The classic use is DELETE: the resource is gone, there is nothing sensible to return, so the server sends 204 and stops.
- How do I fix a 204 error?
- Nothing — the action worked; a blank response here is correct, not a broken page
- Is 204 a client error or a server error?
- 204 is in the 2xx range, which means success. It is not an error at all.
Related pages
- 200 OK The request worked and the response contains what was asked for.
- 201 Created The request succeeded and a new resource was created as a result.
- 206 Partial Content The server is returning only the requested byte range of a file, not the whole t
- 202 Accepted The request was accepted for processing, but the work has not finished yet.
- 207 Multi-Status A WebDAV response carrying separate status codes for several resources at once.
- 203 Non-Authoritative Information The request succeeded, but an intermediary modified the response on the way.
- 205 Reset Content The request succeeded and the client should clear the form that sent it.
- 208 Already Reported Inside a WebDAV multi-status response, this member was already listed earlier so
- 226 IM Used The server is returning a delta against a copy the client already has, rather th