Trang này chưa được dịch.

HTTP 204 No Content

The request succeeded and there is no response body.

Cập nhật

204
No Content
2xx Success
Class
RFC 9110 §15.3.5
Defined in

What does HTTP 204 mean?

The request succeeded and there is no response body. Common for DELETE, for PUT/PATCH that do not return the updated resource, and for CORS preflight responses. A 204 response must not contain a body.

2xx Success: The request was received, understood and accepted.

204 and SEO

A page that returns 204 has no content and will not be indexed.

Example response

HTTP/1.1 204 No Content

How to return a 204 response

Node.js (Express)

res.status(204).json({ error: 'No Content' });

PHP

http_response_code(204);

Python (Flask)

return {'error': 'No Content'}, 204

Go (net/http)

w.WriteHeader(204)

nginx

return 204;

Related status codes

  • 200 OK — The request succeeded and the response body contains the requested resource.
  • 304 Not Modified — The cached copy is still valid, so the server sends no body.

Check which status code a URL returns with the HTTP header checker.

All HTTP status codesSearch the full list of status codes from 100 to 599 with their meanings and SEO impact.
Open the full list

Câu hỏi thường gặp

What does status code 204 mean?
204 No Content: The request succeeded and there is no response body.
Does 204 affect SEO?
A page that returns 204 has no content and will not be indexed.