HTTPError.net

The fastest way to diagnose, understand, and fix any HTTP status code

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

How to Fix It (For Visitors)

How to Fix It (For Developers/Admins)

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.

View the IANA HTTP Status Code Registry →