204 No Content
Fault: Neither
TL;DR
Request successful but no content to return.
The server successfully processed the request but is not returning any content.
What HTTP 204 No Content Means
The server successfully processed the request but is not returning any content.
Request successful but no content to return.
Common Causes
- Successful DELETE request
- Successful PUT/PATCH with no response body
- Form submission with no redirect
How to Fix It (For Visitors)
- No action needed - operation successful
How to Fix It (For Developers/Admins)
- Return 204 for successful DELETE operations
- Use when no response body is needed
Returning a 204 No Content (Code Examples)
If you build APIs or web apps, here is how to send an HTTP 204 response and how to test for it:
Node.js (Express)
app.get('/resource', (req, res) => {
res.status(204).json({ error: 'No Content' });
});
Python (Flask)
@app.route('/resource')
def resource():
return jsonify(error='No Content'), 204
PHP
<?php
http_response_code(204);
header('Content-Type: application/json');
echo json_encode(['error' => 'No Content']);
Check the status with curl
curl -I https://example.com/resource
# Look for: HTTP/1.1 204 No Content
Frequently Asked Questions
What does HTTP 204 No Content mean?
Request successful but no content to return. In short: The server successfully processed the request but is not returning any content.
How should I handle an HTTP 204 No Content response?
Return 204 for successful DELETE operations. Use when no response body is needed.
Official Specification
The 204 No Content status code is defined in RFC 7231 Section 6.3.5.