README
coffee.http418.nl is a coffee pot on the internet, built to RFC 2324, the Hyper Text Coffee Pot Control Protocol. It brews coffee, accepts additions, and expects you to say WHEN. The teapot next door, at tea.http418.nl, does not do coffee.
In the browser
Pick your additions on the front page and press BREW. If you chose milk, a WHEN button appears: press it when you've had enough, as section 2.1.4 of the RFC prescribes.
From the terminal
curl coffee.http418.nl
It speaks the real BREW method from RFC 2324 too, not just GET:
curl -X BREW coffee.http418.nl
Additions go in the Accept-Additions header, exactly as RFC 2324 defines it:
curl -H "Accept-Additions: Whole-milk, Vanilla" coffee.http418.nl
curl can't say WHEN, so the pot stops the milk at a sensible amount on your behalf. If you interrupt with Ctrl+C and your cursor goes missing, tput cnorm brings it back.
Additions
| Milk | Cream, Half-and-half, Whole-milk, Part-Skim, Skim, Non-Dairy |
|---|---|
| Syrup | Vanilla, Almond, Raspberry, Chocolate |
| Spirits | Whisky, Rum, Kahlua, Aquavit |
| Sweeteners, spices | Mentioned in RFC 2324, never defined. So: none. |
Ask for anything else and the pot answers 406 Not Acceptable, with this menu.
Other pots, other drinks
RFC 2324 lets one machine have several pots, addressed as /pot-0, /pot-1 and so on. This machine has two: pot-0 brews coffee, and pot-1 is the espresso machine.
The protocol itself only knows coffee. Ask for an espresso, cappuccino, latte, flat white, macchiato, cortado, mocha, americano, ristretto or lungo, and you get 501 Not Implemented, plus the closest thing the pot can actually make:
curl -i coffee.http418.nl/cappuccino
Coffee in every language the RFC knows
Section 3 of the RFC lists the word for coffee in other languages and declares them all equivalent, so this pot answers to every one of them. Start with the Dutch:
curl coffee.http418.nl/koffie
The full list: koffie, akeita, koffee, kahva, kafe, café, kava, káva, kaffe, kafo, kohv, kahvi, Kaffee, qæhvæ, قهوة, 咖啡, καφέ, कौफी, コーヒー, 커피, кофе, กาแฟ, and plain coffee.
Things this README doesn't tell you
A coffee pot has its secrets too. Some hints:
- There is one thing this pot will never make, and the RFC says why.
- Knowing when to stop matters, and not only for milk.
- Asking a coffee pot for tea produces a very specific kind of error.
- The second pot has seen better days.
- The RFC can't count, and it's picky about capitals.
- Some things are only visible to people who read the source.
Spoilers
- Decaf is a
406, quoting section 2.2.3:curl -i -H "Accept-Additions: Decaf" coffee.http418.nl - Don't press WHEN in the browser and your coffee becomes mostly milk. Pick more than one spirit and the pot gets concerned. Pick all four and it calls you a taxi.
- Tea is
415 Unsupported Media Type.curl -i -X BREW -H "Content-Type: message/teapot" -d start coffee.http418.nl pot-1answers503 Service Unavailable, with aRetry-Afterof one year:curl -i coffee.http418.nl/pot-1- Section 3 promises 29 languages but lists 28. And German must start with a capital K, so
/kaffeeredirects to/Kaffee. - View the source of this page.