204 No Content

A successful request with no message body in the response is signaled by the 204 No Content status code.

A 204 No Content response is cacheable by default and an ETag header is included in this case. To override this behavior, the response needs to include the appropriate Cache-Control headers.

Usage

The 204 No Content status code is returned in response to a POST, PUT, or DELETE operation where no message body is expected. Some servers return a 200 with an empty body and a Content-Length of 0 instead.

A practical use case is the result of a form submission where the user presses a "Save" button. The server commits the changes and relies on the client informing the user of success.

The server must not include a message body in a 204 response. Headers like Cache-Control and ETag are still sent and apply to the document identified by the request.

The related 205 Reset Content status also returns no body but additionally instructs the client to reset the document view (for example, clearing a form after submission). A conditional GET returns a 304 to signal the resource does not need to be retrieved again.

Note

DELETE returning 204 is the most common pattern for simple resource removal with no response body needed. Return 200 instead when the response includes confirmation details or the deleted resource representation. PUT returning 204 is common when the update succeeds and the client does not need the updated representation echoed back. 204 means "success, nothing to show" while 404 means "resource not found." An empty collection query returns 200 with an empty array, not 204.

SEO impact

Google cannot process a 204 response because no content is received. A URL consistently returning 204 will not appear in search results.

Example

The client posts XML data to the server defining a job. The server responds confirming the data was accepted and the job completed. No content needs to be returned, making the 204 No Content status code appropriate.

Request

POST /job HTTP/1.1
Host: www.example.re
Content-Type: application/xml
Content-Length: 68

<?xml version="1.0"?>
<job>
  <id>125</id>
  <task>G01</task>
</job>

Response

HTTP/1.1 204 No Content

Code references

.NET

HttpStatusCode.NoContent

Rust

http::StatusCode::NO_CONTENT

Rails

:no_content

Go

http.StatusNoContent

Symfony

Response::HTTP_NO_CONTENT

Python3.5+

http.HTTPStatus.NO_CONTENT

Java

java.net.HttpURLConnection.HTTP_NO_CONTENT

Apache HttpComponents Core

org.apache.hc.core5.http.HttpStatus.SC_NO_CONTENT

Angular

@angular/common/http/HttpStatusCode.NoContent

See also

Last updated: April 4, 2026