204 No Content

The operation succeeded and deliberately returned no response body.

All HTTP status codes

What does HTTP 204 mean?

A successful request need not return a document. An API may use 204 after applying a change or deleting a resource. It ends at the headers, so clients should not expect a JSON success object afterwards. For a normal website page, an unexpected 204 can explain a blank result even though the HTTP status belongs to the successful range.

An investigation example

Illustrative preferences investigation
Save response: 204 No Content
Preferences are stored correctly.
Client reports an error while parsing empty JSON.
Action: handle successful empty responses explicitly.
Verify: refresh the settings and confirm the saved values without a parsing error.

When this response is used

  • An API confirms a successful deletion or saves an update without returning a representation.
  • A lightweight health endpoint intentionally reports availability using only its status and headers.

Diagnose the response

Check the completed operation, then ensure the client does not attempt to parse a body that is absent.

  • Check the endpoint contract before treating an empty response as an error. A JSON parsing failure in the client may simply mean it incorrectly expected a body.
  • Verify the intended state change through a safe follow-up request. For a deletion, confirm the resource is gone without repeatedly issuing destructive requests.
  • If a public page unexpectedly returns 204, inspect its controller, middleware and CDN rules. Restore a normal HTML representation if users are meant to read the page.

What it means for website monitoring

Check whether an empty response is appropriate for the monitored URL. A healthy API endpoint and a public page expected to contain HTML may need different acceptance criteria.

Reference