| Status code | 204 |
|---|---|
| Status text | No Content |
| Category | 2xx Success |
| Response has body | No |
| Specification | RFC 9110 |
What does 204 No Content mean?
The request succeeded and there is deliberately no response body. It belongs to the 2xx Success class, which means the request was received, understood and accepted.
When do APIs return 204?
Common for DELETE, and for PUT/PATCH when the API does not echo the updated resource.
How to fix a 204 No Content
Nothing to fix. An empty response body here is correct, not a bug — do not try to parse it as JSON.
Reproduce a 204 response
The fastest way to understand a status code is to trigger one and read the full response. Open the
API tester and send a request to https://httpbin.org/status/204 — you will
see the 204 status along with every response header the server sent. Comparing those headers against
a working request is often what reveals the cause.
When you are debugging a real endpoint, check the response headers as carefully as the body, and confirm you are using the right HTTP method for the operation.
Related 2xx status codes
200 OK
The request succeeded and the response body contains the result.
201 Created
The request succeeded and a new resource was created as a result.
202 Accepted
The request was accepted for processing, but the processing has not finished.
206 Partial Content
The server is delivering only part of the resource, as requested by a Range header.
204 No Content FAQ
Can a 204 response have a body?
No. A 204 response ends after the headers, and clients ignore anything sent after them. If you need to return data, use 200.
When should an API return 204 instead of 200?
When the request succeeded and there is nothing useful to return: a DELETE, a PUT or PATCH whose result the client already knows, or a preflight response.
Why does my client fail to parse a 204 response?
Because there is no body to parse. Code that calls a JSON parser on every successful response throws on 204, so check the status or the Content-Length before parsing.
See also
- 200 OK — The request succeeded and the response body contains the result.
- 201 Created — The request succeeded and a new resource was created as a result.
References
- RFC 9110, 204 No Content — The specification that defines this status code.
- MDN: 204 No Content — MDN's reference page for this status code.