4xx Client Errors

HTTP 418 I'm a Teapot

The server refuses to brew coffee because it is, permanently, a teapot. (RFC 2324)

When is 418 used?

  • Easter egg / joke response
  • Used by some APIs as a rate limit indicator

How to handle a 418 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 418 from your server

Node.js (Express)

res.status(418).json({ message: 'I'm a Teapot' });

Python (Flask)

return {"message": "I'm a Teapot"}, 418

Go (net/http)

w.WriteHeader(418)

Frequently Asked Questions

What does HTTP 418 mean?

418 I'm a Teapot: The server refuses to brew coffee because it is, permanently, a teapot. (RFC 2324)

Is 418 an error?

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