Skip to main content
HTTP/2xx (Success)

204 No Content

The server successfully processed the request, but is not returning any content in the response body.

❓ Why does this happen?

Standard response for DELETE operations, PUT updates where returning the entity is unnecessary, or preflight OPTIONS.

✅ How to fix it

Ensure your client does not attempt to parse JSON from 204 responses.

Return or handle 204 in your stack

// app/api/resource/route.ts
export function GET() {
  // 204 must not include a response body
  return new Response(null, {
    status: 204
  });
}

Live 204 mock endpoint

Point your app, tests, or retry logic at this free public URL to reproduce a real 204 response (CORS enabled, optional ?delay=ms up to 5000).

https://castov.com/api/mock/204

204 vs similar status codes

Frequently Asked Questions

What does HTTP Status 204 mean?
The server successfully processed the request, but is not returning any content in the response body.
Why am I getting a 204 status code?
Standard response for DELETE operations, PUT updates where returning the entity is unnecessary, or preflight OPTIONS.
How do I fix a 204 No Content error?
Ensure your client does not attempt to parse JSON from 204 responses.
What is the difference between 204 No Content and 200 OK?
200 returns a body; 204 confirms success with no body at all — clients must not try to parse JSON from a 204.
How can I test how my app handles a 204 response?
Send a request to https://castov.com/api/mock/204 — it returns a real 204 No Content response with CORS enabled. Add ?delay=2000 to simulate a slow server.

Other 2xx status codes

Browse the full HTTP status codes directory or troubleshoot terminal errors in the Error Fix Encyclopedia.