418 I'm a Teapot
Client Error - The server refuses to brew coffee because it is a teapot
HTTP 418 I'm a Teapot
What It Means
The HTTP 418 I'm a Teapot status code is an April Fools' joke defined in RFC 2324, the Hyper Text Coffee Pot Control Protocol (HTCPCP). It indicates that the server refuses to brew coffee because it is, permanently, a teapot.
The Origin Story
In 1998, Larry Masinter authored RFC 2324 as an April Fools' Day joke. The document describes a protocol for controlling, monitoring, and diagnosing coffee pots. The 418 status code was defined to handle situations where a client mistakenly tries to brew coffee with a teapot.
From the RFC
"Any attempt to brew coffee with a teapot should result in the error code '418 I'm a teapot'. The resulting entity body MAY be short and stout."
Real-World Usage
Despite being a joke, 418 has found practical uses:
- Easter eggs: Many websites return 418 at special endpoints (try google.com/teapot)
- Developer humor: Used in demos and examples to add personality
- Bot blocking: Some services return 418 to block automated requests
- Testing: Useful for testing HTTP client error handling
The Save 418 Movement
In 2017, the IETF considered removing 418 from Node.js and Go. Developers rallied to "Save 418", arguing it represented the playful spirit of the internet. Both languages ultimately kept the status code.
Example Implementation
// Express.js
app.get('/teapot', (req, res) => {
res.status(418).json({
error: "I'm a teapot",
body: "short and stout"
});
});
// Python Flask
@app.route('/teapot')
def teapot():
return "I'm a teapot", 418
Should You Use It?
While fun, 418 shouldn't be used for actual error handling in production APIs. Stick to standard 4xx codes for real client errors. Reserve 418 for easter eggs, humor, or special cases where you want to add some developer joy.