Toolman

HTTP 418 — I'm a Teapot

4xx Client Error

What it means

Defined in a 1998 April Fools' RFC for the Hyper Text Coffee Pot Control Protocol. It is a joke that several frameworks implement anyway.

What to do about it

Nothing to fix. Attempts to remove it from libraries have been resisted with unusual vigour.

Where it sits

418 belongs to the 4xx family: The request contains something the server will not or cannot process. The fix is normally on the client side.

HTTP/1.1 418 I'm a Teapot

Checking it yourself

# see the status code and headers only
curl -sI https://example.com/path

# follow redirects and print each hop
curl -sIL -o /dev/null -w "%{http_code} %{url_effective}\n" https://example.com/path

# JavaScript
const r = await fetch(url);
console.log(r.status, r.statusText);

How this code behaves

Cacheable by defaultNo — caches must not store this response unless explicit cache headers permit it.
Safe to retryNo. Retrying an identical request will produce the same result — the request itself must change.
Effect on search indexingNo direct effect.

Returning 418 correctly

# nginx
return 418;

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

# Go
w.WriteHeader(418)

# Python (Flask)
return jsonify(error='I'm a Teapot'), 418;

Frequently asked questions

What does HTTP 418 mean?

Defined in a 1998 April Fools' RFC for the Hyper Text Coffee Pot Control Protocol. It is a joke that several frameworks implement anyway.

How do I fix a 418 error?

Nothing to fix. Attempts to remove it from libraries have been resisted with unusual vigour.

Is 418 a client or server problem?

A client problem by definition — the request needs to change. That said, a 4xx can still be the server’s fault if it is misconfigured and rejecting valid requests.

Other 4xx codes

All HTTP status codes