HTTP 204 No Content
HTTP 204 No Content means the request succeeded but there is no response body to send. It is commonly returned after a successful DELETE, a PUT that saved…
Quick answer
HTTP 204 No Content means the request succeeded but there is no response body to send. It is commonly returned after a successful DELETE, a PUT that saved changes, or an analytics beacon. A 204 response must not include a body.
Last updated · Maintained by FreeAIToolz · How we test
What does HTTP 204 No Content mean?
Clients should not expect any content. Browsers that receive 204 for a navigation stay on the current page. Headers such as ETag can still be sent to describe the updated resource.
| Status code | 204 |
|---|---|
| Name | No Content |
| Class | 2xx Success |
| Defined in | RFC 9110 §15.3.5 |
| Cacheable by default | Yes (heuristically cacheable) |
| Safe to retry automatically? | Not applicable |
What causes HTTP 204?
- A successful operation with nothing to return.
How do I fix HTTP 204?
- Do not send a body or a Content-Length greater than 0; some proxies treat that as a protocol error.
- If the client needs the updated object, return 200 with the body instead.
What should a client do after HTTP 204?
Treat as success. Do not try to parse JSON from the empty body (fetch(...).json() will throw).
Does HTTP 204 affect SEO?
Pages returning 204 have no content to index. Never use 204 for a public page.
Example 204 response
HTTP/1.1 204 No Content
Date: Mon, 01 Dec 2026 12:00:00 GMT How to return 204 No Content in code
Express (Node.js)
res.status(204).end(); Next.js route handler
return new Response(null, { status: 204 }); FastAPI (Python)
return Response(status_code=204) PHP
http_response_code(204); Nginx
location = /example {
return 204;
} Other 2xx status codes
The request was received, understood and accepted.
Frequently asked questions
Why does response.json() fail on a 204?
204 or 200 after DELETE?
Is 204 a client or server error?
Related
- 200 OK HTTP 200 OK means the request succeeded.
- 304 Not Modified HTTP 304 Not Modified means the client’s cached copy is still valid, so the server sends no body.
- 404 Not Found HTTP 404 Not Found means the server cannot find anything at the requested URL.
- Open the HTTP Status Codes Reference → Free, no signup.