2xx Success

HTTP 204 No Content

The request succeeded and there is no body to return. Common for DELETE and PUT.

204 No Content means the request succeeded and there is deliberately no body. Clients should not try to parse one.

HTTP/1.1 204 No Content

When servers send it

  • A DELETE that removed the resource.
  • A PUT or PATCH that saved changes without returning the new representation.
  • CORS preflight (OPTIONS) responses.

How to handle it

  • Do not call response.json() on a 204: there is nothing to parse and most clients throw.
  • If you need the updated resource back, the server should answer 200 with a body instead.

Related status codes

Other status codes

1xx Informational

2xx Success

3xx Redirection

5xx Server error

Search all HTTP status codes