It started back in 1998 as an April Fool's Day gag. Written up by Larry Masinter of the Internet Engineering Task Force (IETF), error code 418 — "I'm a teapot" — was nothing more than a poke at the "many bad HTTP extensions that had been proposed". Despite its existence as a joke, a number of major software projects, including Node.js, ASP.NET and Google's Go language, implemented it as an Easter egg. A recent attempt to excise the fictitious code from these projects ended up doing the opposite, cementing it as a "reserved" error by the IETF.
Update 14/08: The original article incorrectly identified Mark Nottingham. This has now been addressed.
You're likely familiar with other 400 error codes, such as 404 "page not found" or 403 "forbidden". At a basic level, they serve two functions — informing a user as to why a web request failed and providing browsers, servers and other online services a standardised way of recognising and potentially responding to them.
The 418 code wasn't introduced alone, but as part of a larger April Fool's Day joke — the "Hyper Text Coffee Pot Control Protocol (HTCPCP/1.0)". The fake protocol is described thusly by author Larry Masinter:
This document describes HTCPCP, a protocol for controlling, monitoring, and diagnosing coffee pots.
And here's the error code from the specification:
2.3.2 418 I'm a teapot 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.
As you can imagine, there wasn't much demand for such a protocol — or the error — back in 1998 and indeed in 2017, the situation has remained unchanged. Even so, over the years, various major software projects decided to add the code. Not for any practical purpose, more as an in-joke for those aware of the prank.
Turns out a lot of people had a problem with removing the seemingly harmless error code. Nottingham's argument was that 418 was "polluting [the] core protocol" of these projects. Here's part of his comment from his post on the Go code repository:
While we have a number of spare 4xx HTTP status codes that are unregistered now, the semantics of HTTP are something that (hopefully) are going to last for a long time, so one day we may need this code point.
Please consider removing support for 418 from Go HTTP, since it's not a HTTP status code (even by its own definition). I know it's amusing, I know that a few people have knocked up implementations for fun, but it shouldn't pollute the core protocol.
From a pragmatic point of view, Nottingham has a point. Masinter admitted years ago it serves little purpose other than as satire:
@ExceptionFound Satire: make fun of many bad HTTP extensions that had been proposed.
— Larry Masinter (@masinter) November 2, 2015
It didn't take long for a "Save 418" website to go live and through the efforts of interested internet historians (and jokers), all three of the aforementioned projects have decided to keep the code as it is, though Google will "revisit" the situation with the next major version of Go.
Nottingham, apparently seeing the error of his ways, filed for the IETF to make 418 a reserved code, essentially transforming it from a decade-old April Fool's gag to an official thing. Well, as official as a fake error code can be.
Here's the description from the draft document:
This document changes 418 to the status of "Reserved" in the IANA HTTP Status Code registry to reflect that. This indicates that the status code cannot be assigned to other applications currently. If future circumstances require its use (e.g., exhaustion of all other 4NN status codes), it can be reassigned to another use.
It doesn't mean Chrome will suddenly bring your kettle to life, but it does mean 418 will never be used for anything else, at least for now. And who knows... with the Internet of Things gaining traction, we may need a way to scold those who use their teapots for unspecified coffee brewing soon rather than later.