What HTTP 204 means
Typical for DELETE, for PUT or PATCH when the client already has the new state, and for CORS preflight (OPTIONS) responses. A 204 response must not have a body. Browsers that submit a form and get 204 stay on the current page.
Using 204 correctly
-
Some clients choke on
Content-Type: application/jsonwith an empty 204 body when they try to parse it. Check for 204 before callingresponse.json().
Retrying
Not applicable: this isn’t an error.
Example response
HTTP/1.1 204 No Content
Date: Wed, 21 Oct 2026 10:30:00 GMT
How to return 204
res.status(204).end();
from fastapi import Response
return Response(status_code=204)
w.WriteHeader(http.StatusNoContent)
Related status codes
- 200 OK : The request succeeded and the response contains the result.
- 205 Reset Content : Tells the client the request succeeded and it should reset the document view, such as clearing a form.
- 404 Not Found : The server can’t find the requested resource.
Other 2xx status codes
200 OK · 201 Created · 202 Accepted · 203 Non-Authoritative Information · 205 Reset Content · 206 Partial Content · 207 Multi-Status
See the full list of HTTP status codes.
Sources
Spotted a mistake? Email hello@devtoolsmith.com and we’ll fix it.
Frequently asked questions
What does HTTP 204 No Content mean?
HTTP 204 No Content means the request succeeded and there is no response body. Typical for DELETE, for PUT or PATCH when the client already has the new state, and for CORS preflight (OPTIONS) responses. A 204 response must not have a body. Browsers that submit a form and get 204 stay on the current page.