DevKits
204

No Content

2xx Success

Last updated:

The request succeeded, and there is no additional content to send in the response body.

Description

Signals success but with an intentionally empty body. Common for DELETE requests, PUT updates that don't need to echo the resource, and idempotent form submissions.

When to use

Return 204 for successful DELETE, or for PUT/PATCH when you have no useful body to return.

Common pitfalls

A 204 response MUST have an empty body. Some frameworks accidentally include whitespace, breaking spec-strict clients.

Specification

RFC 9110 §15.3.5

Examples

HTTP response
HTTP/1.1 204 No Content
Content-Type: application/json

{"ok":true}
Node.js (Express)
res.status(204).json({ error: "No Content" });
Go (net/http)
w.WriteHeader(http.StatusNoContent)
Python (Flask)
return jsonify({"error": "No Content"}), 204

Related status codes

All 2xx codes