Zum Inhalt springen

HTTP 418: The Error Code That Exists to Brew Nothing

Zusammenfassung

HTTP status code 418 “I’m a Teapot” is a real, standardized HTTP response code, defined in RFC 2324 published on April 1, 1998. The RFC specifies the Hyper Text Coffee Pot Control Protocol (HTCPCP), a mock protocol for controlling internet-connected coffee pots. The 418 error should be returned when a teapot is asked to brew coffee. The code was an April Fools’ Day joke — but it was a real RFC, filed with the IETF, and modern web frameworks implement it. Multiple web servers return 418 responses to requests they choose to reject whimsically.

RFC 2324 and HTCPCP

RFC 2324 was submitted to the IETF (Internet Engineering Task Force) by Larry Masinter on April 1, 1998. The IETF has a tradition of publishing humorous RFCs on April 1; RFC 2324 is among the most famous.

The document specifies HTCPCP — “an extension of HTTP, transfer of well-defined, structured hypertext documents, for the control, monitoring, and diagnosis of coffee pots.” The protocol defines:

  • BREW method: Added to HTTP, used to initiate brewing.
  • WHEN method: Added to signal to stop pouring (for tea with milk).
  • HTTP 406 Not Acceptable: Returned when the client requests a type of coffee the server cannot produce.
  • HTTP 418 I’m a Teapot: Returned when a teapot is asked to brew coffee. “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.”

RFC 2324 was updated in 2014 by RFC 7168, which added support for tea-brewing.

Serious Implementations

The joke succeeded well enough that real web software implements 418. Node.js’s HTTP library includes it. Python’s requests library handles it. The Rack gem for Ruby includes it. Most major programming languages’ HTTP client and server libraries include 418 as a valid status code.

Some developers return 418 from APIs as a way to indicate that a particular endpoint exists but is intentionally not providing the requested service — a more whimsical alternative to 403 Forbidden or 501 Not Implemented. The code has been used in educational contexts, conference talks, and API documentation.

In 2017, a developer proposed removing 418 from Node.js’s HTTP implementation to clean up the codebase. The pull request attracted over 200 comments and generated significant community pushback. Mark Nottingham, chair of the IETF HTTP Working Group, wrote a draft to formally reserve 418 as “I’m a Teapot” to prevent it from being assigned to any serious purpose in the future. The code is now officially preserved.

The April 1 RFC Tradition

The IETF has published April Fools’ RFCs since at least 1989. Other notable examples:

  • RFC 1149 (1990): “A Standard for the Transmission of IP Datagrams on Avian Carriers” — specifying IP over carrier pigeons. This was later implemented and tested.
  • RFC 2549 (1999): Update to RFC 1149, adding quality-of-service requirements for pigeon carriers.
  • RFC 3514 (2003): “The Security Flag in the IPv4 Header” — proposing that evil packets set a “security bit” to identify themselves.

The 418 code’s endurance reflects a broader culture in the internet engineering community: serious technical work coexists with humor, and the humor sometimes produces implementations that outlast their jokes. The Open Standards Process that produces RFCs makes room for both.


📚 Sources