sudo make me a sandwich
The handler itself was pretty straight-forward. It recieved a POST request from an SMS gateway which contained the details about the SMS recieved. In response it expected a 200 OK response - anything else and it would assume an error and retry in 5 mins.
HTTP Error codes
Most people will be familiar with some of the error codes.
- 404 Not Found (which has an interesting back-story)
- 403 Forbidden
- 500 Internal Server Error
But as I could send pretty much send any code I wanted (anything other than a 200 OK) without having to worry about wether or not the browser would understand it (it being server⇒server) I decided to have a look and see what other codes where available which better suited my purposes.
Of course once again wikipedia proved to be a great resource, providing a list of HTTP status codes some of which matched my needs much better than a 404 or 500.
For example the handler will only be used to process POST requests, so when GET is used I send a 405 Method Not Allowed. But one error code really stood out among the rest.
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.
From: RFC 2324 - Hyper Text Coffee Pot Control Protocol (HTCPCP/1.0)
Basically if a network attached Teapot recieves a coffee making request it should respond with a 418 error code. Good to know!
The RFC document also introduces some other introducing tid-bits, such as the WHEN method.
When coffee is poured, and milk is offered, it is necessary for the holder of the recipient of milk to say “when” at the time when sufficient milk has been introduced into the coffee. For the purpose, the “WHEN” method has been added to HTCPCP. Enough? Say WHEN.
WTF does this have to do with Sandwiches?
Not an awful lot except it made me think of the xkcd comic.

Proper User Policy apparently means Simon Says.
If we are writing spec docs for network attached Coffee makers (including their own methods, accepted headers and error codes) how long till we have sandwich makers we can call from the command line?
Hell we can already order pizzas!
(Thanks to -fumtu for the thumbnail image)









1. This comment form has a typo => “Mail Adress” should be “Mail Address”
2. Nice find, I stumbled on it not too long ago. You’re wondering about sandwiches and I found this Reference at the bottom of the HTCPCP RFC:
[HTSVMP] Q. Stafford-Fraser, “Hyper Text Sandwich Van Monitoring - Protocol, Version 3.2″. In preparation.
I’m really worried about the security though:
“Anyone who gets in between me and my morning coffee should be insecure.”
Thanks Joseph the typo has been fixed
I think you’re right as well, more work does need to be put into the security considerations - the biggest risk:
> Putting coffee grounds into Internet plumbing may result in clogged plumbing
Oh noes! Not clogged tubes!
Hmm…RFC 2324 dated 1 April, 1998.
Leave your response!
What we're watching
Categories
Projects
Tags
Acoustic AIR ajax alternatives Android Apple BBC Blues checkboxes codeignitor comedy Dark Dominion decisions Desktop ebay error feedback festival Folk forms Google Guitar Hi-Tech horror iPhone Iran iTunes Matt Cutts movies mp3 Music Photoshop ratings reviews RIAs search Singer-Songwriter snippely snippet snippets stumbleupon T in the Park toggle traffic Web SpamArchives
Meta
Recent Comments
About
Most Commented