Thursday, February 24, 2011

Fun with HTTP Response Codes

I’ve been looking at REST and hypermedia for a current project and wanted to get to know the response codes that are possible. I also wanted to see how conversational they really are so I used a semi-fictitious conversation I had with my wife about private school where she was making requests and I was responding in HTTP Response codes.

A: Steve? What do you think of sending Ayda to private school at 650/month

Me: 102 Processing

Me: 409 Conflict

Me: 400 Bad Request -  No

A: Listen to me! If she doesn’t go to a good school her potential could be lost. Look at these scores of the current school?

Me: 202 Accepted – They look pretty Bad

Me: 307 Temporary Redirect I’m watching football can we talk about this later

A: No Look at the curriculum of the private school

Me: 202 Accepted – This looks pretty good. Science taught in the 1st grade.

Me 204 No Content

A: I was talking to the teacher at the private school and she said blah blah blah blah

Me: 414 Request-URI Too Long

A: Can we afford it?

Me: 507 Insufficient Storage and 509 Bandwidth Limit Exceeded

A: We could pay for it by getting credit cards

Me: 403 Forbidden or  406 Not Acceptable

A: Do you think we could ask for help from a you Mom to pay for this.

Me: 407 Proxy Authentication Required

A: Well, You don’t have a choice

Me: 402 Payment Required