204 No Content
The HTTP
204 No Content successful response status code indicates that a request has succeeded, but the client doesn't need to navigate away from its current page.
A 204 response is cacheable by default, and an ETag header is included in such cases.A
204 No Content in response to these request methods has the following meaning and results:DELETE: The action was successful, and no further information needs to be supplied.PUT: The action was successful, and theETagvalue contains the entity tag for the new representation of that target resource.
A
204 response can be used when implementing "save and continue editing" functionality for applications like wiki sites.
In this case, a PUT request could be used to save the page contents, and a 204 No Content response indicates to the browser that the editor should not be replaced by other content.Note that the response must not include any content or the
Content-Length header (browsers may reject responses that include content).Status
Examples
Receiving a response after deleting an image
In this example, the client sends a request to delete an image using the
DELETE method.
The request includes an Authorization header with a token to authenticate the request:After successfully deleting the image, the server responds with a
204 response with no body, indicating no further information needs to be sent to the client.Specifications
| Specification |
|---|
| HTTP Semantics # status.204 (external) |

