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 ContentWhen 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.