4xx Client Errors

HTTP 451 Unavailable For Legal Reasons

The resource is blocked due to legal demands (censorship).

When is 451 used?

  • DMCA takedowns
  • GDPR compliance blocks
  • Government censorship

How to handle a 451 response

Inspect the request — URL, method, headers, credentials, and body. Retrying the same request unchanged will usually fail again; 429 is the exception, where you should wait for the Retry-After period.

Check the status code a URL returns from the command line:

curl -s -o /dev/null -w "%{http_code}\n" https://example.com

How to return 451 from your server

Node.js (Express)

res.status(451).json({ message: 'Unavailable For Legal Reasons' });

Python (Flask)

return {"message": "Unavailable For Legal Reasons"}, 451

Go (net/http)

w.WriteHeader(451)

Frequently Asked Questions

What does HTTP 451 mean?

451 Unavailable For Legal Reasons: The resource is blocked due to legal demands (censorship).

Is 451 an error?

Yes. 451 is in the 4xx Client Errors class. Client errors: the request is malformed, unauthorized, or targets something that does not exist.