Skip to main content
204

No Content

Active
RFC 9110 §15.3.5Since 1996REST APIs, DELETE operations

HTTP 204 No Content indicates the server successfully processed the request but is not returning any content. Defined in RFC 9110 §15.3.5. Common for DELETE operations and PUT updates where no response body is needed.

Description

The 204 No Content status code indicates that the server has successfully fulfilled the request and there is no additional content to send in the response content. Metadata in response headers may refer to the target resource and its selected representation.

A 204 response is terminated by the end of the header section — it cannot contain a message body or trailers. The response is cacheable by default.

Examples

DELETE request
http
DELETE /api/users/42 HTTP/1.1
Host: api.example.com
Authorization: Bearer token123
204 response (no body)
http
HTTP/1.1 204 No Content

Edge Cases

  • A 204 response MUST NOT include a message body — no Content-Length, no Transfer-Encoding.
  • Browsers receiving 204 should not navigate away from the current page.
  • Some HTTP client libraries throw errors on 204 if they try to parse a JSON body.

When You'll See This

  • Successfully deleting a resource
  • Updating a resource with PUT where no body is needed in response
  • CORS preflight responses
  • Saving without navigating away (form auto-save)

Implementation References

LanguageConstant
Gohttp.StatusNoContent
Rusthttp::StatusCode::NO_CONTENT
Pythonhttp.HTTPStatus.NO_CONTENT
Node.jshttp.STATUS_CODES[204]
.NETHttpStatusCode.NoContent
JavaHttpURLConnection.HTTP_NO_CONTENT

History

Introduced in HTTP/1.0 (RFC 1945, 1996). Commonly used in RESTful APIs for operations that don't need to return data.

Related Status Codes

FAQ

When should I use 204 vs 200?

Use 204 when the action succeeded and there's nothing to return in the body. Use 200 if you're returning confirmation data, the deleted resource's final state, or any other body content.

Can a 204 response have headers?

Yes. A 204 can include headers like ETag, Cache-Control, or custom headers. It just cannot have a body.