Qaynaq LABS · TOOLS

HTTP · 2xx Success

204 No Content

Request succeeded but server returns no content in response body.

When you see this status

  • DELETE request completes successfully with no response body
  • PUT request updates resource with no new data to return
  • PATCH request modifies resource with no response payload
  • Form submission succeeds without redirecting or returning data

Common causes

  • Intentional omission of response body by API design
  • Client request processed successfully but no data generated
  • Server suppresses response body to reduce bandwidth
  • Resource deletion confirmed with no further details

How to debug it

  1. Verify client expects no response body for this endpoint
  2. Check server logs for successful request processing
  3. Ensure no middleware accidentally adds response content
  4. Confirm client handles empty response body correctly

Return this code in your framework

Express (Node.js)
res.status(204).send();
FastAPI (Python)
return Response(status_code=204);
NestJS
@Get(':id')
remove(@Param('id') id: string) {
  this.service.delete(id);
  return new HttpCode(HttpStatus.NO_CONTENT);
}
Go (net/http)
w.WriteHeader(http.StatusNoContent)

About HTTP 204

HTTP status code 204 No Content is part of the 2xx Success family. Request succeeded but server returns no content in response body. Understanding it is essential for backend engineers, API designers, and anyone debugging integrations between services.

The Qaynaq Labs HTTP Status Code Explainer covers all standard codes with practical guidance: what triggers them, how to debug them in production, and exactly how to return them from common frameworks. Each code page is hand-curated and verified.

Frequently asked

Can I include headers with a 204 response?

Yes, headers can be included but the response body must be empty. Useful for caching or CORS directives.

Why use 204 instead of 200 with empty body?

204 explicitly indicates no content is expected, improving API clarity and client handling expectations.

Does 204 require a Content-Length header?

No, the Content-Length header must be omitted as there is no response body. Servers should not include it.