204 No Content

Success - Request succeeded, no body returned

HTTP 204 No Content

What It Means

The HTTP 204 No Content status code indicates that the server successfully processed the request, but is not returning any content. The response must not contain a response body.

When to Use 204

  • DELETE requests: After successfully deleting a resource
  • PUT/PATCH requests: When update succeeds but you don't need to return the updated resource
  • Auto-save operations: Background saves that don't need confirmation data
  • Acknowledgments: When you just need to confirm receipt

Example Response

HTTP/1.1 204 No Content
Date: Mon, 15 Jan 2025 10:30:00 GMT
X-Request-Id: abc123

(no body)

204 vs 200 with Empty Body

Don't return 200 with an empty body. If there's no content to return, use 204. The semantic difference matters:

  • 200 {} — "Here's your empty object"
  • 204 — "Success, nothing to return"

Common Use Cases

Operation Response
DELETE /api/users/123 204
PUT (update, no return needed) 204
POST /api/logout 204
POST /api/read-receipts 204

Important Notes

  • 204 responses must not include a message body
  • The response is terminated by the first empty line after headers
  • Can include headers like ETag or custom headers
  • Browsers may retain the current page when receiving 204

When NOT to Use 204

  • When the client needs the updated resource (use 200 with body)
  • When creating resources (use 201)
  • When returning search results, even if empty (use 200 with empty array)

Frequently Asked Questions

What does HTTP 204 No Content mean?
HTTP 204 No Content indicates that the server successfully processed the request but is not returning any content. The response has no body. This is commonly used for DELETE operations or updates where no response data is needed.
When should I use 204 vs 200?
Use 204 when the operation succeeds but there is nothing meaningful to return, such as after a DELETE operation. Use 200 when you need to return data in the response body, such as returning the updated resource after a PUT/PATCH.
Can 204 responses have a body?
No. By specification, a 204 response must not include a message body. If your server includes a body with a 204 status, some clients may ignore it or behave unexpectedly. If you need to return data, use 200 instead.
How is 204 different from 404?
204 means the request was successful but there is intentionally no content to return. 404 means the resource was not found. For example, a successful DELETE returns 204, while trying to DELETE a non-existent resource returns 404.
How do I monitor endpoints that return 204?
UptimeSignal can be configured to expect specific status codes. For DELETE or update endpoints, you can set the expected status to 204 No Content. You will be alerted if the endpoint starts returning a different status code.

Monitor your DELETE endpoints

Ensure your DELETE endpoints return correct status codes.

Start monitoring free →

Related Status Codes

More Resources