DevToolsmith

HTTP 204 No Content

HTTP 204 No Content means the request succeeded and there is no response body. The request was received, understood and accepted.

Class
2xx Success
Standard
RFC 9110
Cacheable by default
Yes
Safe to retry
Not applicable: this isn’t an error
Go constant
http.StatusNoContent

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/json with an empty 204 body when they try to parse it. Check for 204 before calling response.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

Node.js (Express)
res.status(204).end();
Python (FastAPI)
from fastapi import Response

return Response(status_code=204)
Go (net/http)
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.