HTTP Conversation Codes
So at lunch today myself, Isaac and a bunch of other co-workers who would probably prefer to remain nameless were having one of those free-flowing, ultra-nerdy conversations that you only get when you concentrate a bunch of incredibly technical people in one place and then prevent them, through social convention, from talking about work. These are pretty much a daily occurrence at Yahoo! at lunch time.
The conversation somehow turned -- I think it was Isaac's idea, so perhaps he can illuminate us as to his inspiration -- to the idea of simplifying conversation by referring to common workplace situations by their equivalent HTTP status codes. This turned out to be incredibly easy, and possibly even useful.
For the non-nerdy, a brief explanation: HTTP is the language your web browser uses to speak to web servers to request your pages. It's how the web server knows which content (such as a web page) you want to see. This happens before HTML or any other language gets involved, and it's used whether the content you're requesting is a web page, a picture, a movie or a file to download. The status codes are how the web server tells your browser (aka your client) roughly how things went -- so your browser knows whether the page you're seeing is the page you asked for, or whether it's an error page, or any number of other things.
This maps pretty well to a conversation between a programmer and a normal person. The normal person -- a manager, or a product person, or a marketroid -- wants something from the programmer, and the programmer needs to tell them what's going on, and often they can't just do that by giving them exactly what they asked for. And since programmers are notably bad at communicating with normal people but notably good at being very accurate about codes, this translation guide can help.
I'm not sure how often we will end up actually using these in real life -- although people occasionally use 404 already, and I am absolutely positive that 502 is going to come in handy -- but they at the very least serve as a very quick way of reminding you what the codes mean, if you happen to be building a web service. And if you're me, you're building a new web service every other bloody day, because that's all they want these days, another goddamn web service. Ahem.
Without further ado:
|101||Switching Protocols||Let's take this offline|
|201||Created||I wrote you an email about that|
|202||Accepted||If you say so.|
|203||Non-Authoritative Information||The last I heard...|
|205||Reset Content||Forget what Bob told you|
|206||Partial Content||All I know is...|
|300||Multiple Choices||You can get that from Bob, or John, or Sue|
|301||Moved Permanently||That's Bob's job|
|302||Found||Bob is taking care of that for me today|
|303||See Other||You should ask Bob today, but I'll know tomorrow (not well understood by clients)|
|304||Not Modified||It's the same as it was when you asked me 5 minutes ago|
|305||Use Proxy||You should ask my boss|
|307||Temporary Redirect||Ask Bob about that|
|4xx: Client error|
|401||Unauthorized||You're not allowed to know that.|
|402||Payment Required||Maybe a twenty would refresh my memory...|
|403||Forbidden||It's a secret.|
|404||Not Found||I have no idea what you're talking about.|
|405||Method not allowed||gasp of shock|
|406||Not Acceptable||Maybe when you're older|
|407||Proxy Authentication Required||You need to file a bug about that|
|408||Request Timeout||You still there?|
|409||Conflict||I'm working on it right now; ask me later|
|410||Gone||I don't know, and I don't care.|
|411||Length Required||Is this gonna take long?|
|412||Precondition Failed||You asked me not to tell you if it was bad news.|
|413||Request Entity Too Large||Woah, woah, this is too much detail.|
|414||Request URI Too Long||By the time you finished asking the question I forgot what it was about|
|415||Unsupported Media Type||Speak English!|
|416||Requested Range Not Satisfiable||That's all I know|
|417||Expectation Failed||You're not gonna like this|
|5xx: Server error|
|500||Internal Server Error||drooling from side of mouth|
|501||Not Implemented||Uh, yeah, about that...|
|502||Bad Gateway||Bob is refusing to work with me on this.|
|503||Service Unavailable||I am way too busy to deal with your shit|
Interesting side note: even at the protocol level, the programmer's expectation that it is nearly always the client's fault and hardly ever the programmer's fault is obvious.
These codes and their definitions are based on the HTTP 1.1 specification. We welcome suggestions for further refinement.