What 204 means
Common for DELETE, and for PUT or PATCH when the server doesn't return the updated resource.
Common causes
- A successful DELETE, update or action with nothing to return.
How to fix it
If you're calling an API
- Don't call response.json() on a 204: there's no body, so JSON parsing throws.
If you run the server
- Never include a body with 204.
Should you retry?
No need.
Example response
HTTP/1.1 204 No ContentDefined in: RFC 9110 (HTTP Semantics). 204 is a success.