httpstatuses/contents/codes/204.md

43 lines
1.8 KiB
Markdown
Raw Normal View History

2015-11-06 21:39:33 +01:00
---
set: 2
code: 204
title: No Content
references:
"Rails HTTP Status Symbol": ":no_content"
2015-11-06 21:39:33 +01:00
---
The 204 (No Content) status code indicates that the server has successfully
fulfilled the request and that there is no additional content to send in the
response payload body. Metadata in the response header fields refer to the
target resource and its selected representation after the requested action was
applied.
For example, if a 204 status code is received in response to a PUT request and
the response contains an ETag header field, then the PUT was successful and the
ETag field-value contains the entity-tag for the new representation of that
target resource.
The 204 response allows a server to indicate that the action has been
successfully applied to the target resource, while implying that the user agent
does not need to traverse away from its current "document view" (if any). The
server assumes that the user agent will provide some indication of the success
to its user, in accord with its own interface, and apply any new or updated
metadata in the response to its active representation.
For example, a 204 status code is commonly used with document editing interfaces
corresponding to a "save" action, such that the document being saved remains
available to the user for editing. It is also frequently used with interfaces
that expect automated data transfers to be prevalent, such as within distributed
version control systems.
A 204 response is terminated by the first empty line after the header fields
because it cannot contain a message body.
A 204 response is cacheable by default; i.e., unless otherwise indicated by the
method definition or explicit cache controls
(see [Section 4.2.2 of RFC7234][1]).
Source: [RFC7231 Section 6.3.5][2]
[1]: <http://tools.ietf.org/html/rfc7234#section-4.2.2>
[2]: <http://tools.ietf.org/html/rfc7231#section-6.3.5>