HTTP 204 No Content

Success with an intentionally empty body — the request worked, there is just nothing to send back.

What HTTP 204 means

HTTP 204 No Content signals success exactly like 200, except the response deliberately has no body. It is the idiomatic answer for DELETE requests, for PUT/PATCH updates where returning the object would be redundant, and for beacon or logging endpoints.

Because a 204 must not contain a body, JSON parsing a 204 response in client code (for example calling response.json() after fetch) throws — a very common bug. Check the status before parsing.

Common causes of 204 responses

  • A DELETE request removed the resource.
  • A PUT or PATCH updated a resource and the server chose not to echo it back.
  • An endpoint that only records data (analytics beacons, health checks) confirmed receipt.

Good practices for developers

  • Never include a response body with 204 — many servers and proxies will break the connection if you do.
  • In client code, branch on status 204 before calling .json() or .text().
  • If clients need the updated representation, return 200 with the body instead of 204.

Example response

HTTP/1.1 204 No Content
Date: Thu, 02 Jul 2026 10:00:00 GMT

FAQ

What is the difference between 204 and 200 with an empty body?

Practically they behave the same, but 204 is explicit: the absence of a body is intentional and clients should not try to parse one.

Why does response.json() fail on a 204?

A 204 response has no body at all, so there is nothing to parse. Check response.status === 204 before parsing.

Should DELETE always return 204?

It is the most common choice. Returning 200 with a confirmation body is also valid if clients need details about what was deleted.