Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
New HTTP status codes (rooftopsolutions.nl)
48 points by vgnet on May 5, 2012 | hide | past | favorite | 15 comments


Code 511 sounds really useful. If captive portals actually implemented this, it would help efforts like Convergence[1] to handle captive portals gracefully, rather than having to play a heuristic guessing game.

It'll be interesting to see if browser vendors and captive portal vendors both implement this, and what level of adoption they both reach.

[1] - http://convergence.io/


Not sure I expect them to implement it in the near term alas.


I'll be honest, when I read the title on HN I thought for sure this post was going to make me rage.

When I finally reached the content on google's webcache I was pleasantly surprised. All these new status codes are not only useful, but they address issues that exists today.


I don't understand the rationale behind the new codes.

In particular, look at the first one: 428 Precondition Required. This is essentially the server saying to the client, "You don't know how to make requests to me." What is the client supposed to do about it? Make requests that can result in the desired responses, of course, or stop making requests. But that's true of any 4xx response code. So what functionality does the new 428 code add? None that I can see.

If you click through to the RFC itself, the section on 428 says:

  Responses using this status code SHOULD explain how to resubmit the
  request successfully.
It then gives an example of an HTML body representing a human-readable message that explains that "If-Match" should be used. Fine, that's good. I approve. But every HTTP response comes with a body; we can already do this just fine without having code 428.

So, again, what actual functionality does the 428 response code get us? It results in a bit of new code being added to every web client, making them all just a teensy bit more complicated. But to what end?


> What is the client supposed to do about it?

Um...send a proper request? This seems like a perfectly fine code to me. Suppose you have an HTTP request that takes two parameters and the client only sends one of them. Which of the other existing 4xx codes would be appropriate for that situation? "400 Bad Request" is probably what you'd use currently, but as defined it indicates a syntactic error with the request rather than a semantic one.


Presumably the client either does or does not know how to send a proper request so if it is receiving the error message it might as well behave the same way as any other 4xx code.


Yes but presumably the message will point to the API documentation page that explains this. It is a case of lost updates or this error.


Indeed. But, again, we could already do that without the 428 code. And so the situation is: response code 428 tells the client nothing beyond the info gotten from any 4xx response code. The response body tells a human something. The addition of the new response code helps neither one.


Why? I'm reminded of a line from the SIP v4 draft[1].

"This is not the real world, this is the IETF."

1: http://tools.ietf.org/html/draft-kaplan-sip-four-oh-00


The entire concept of status codes is odd to me. Responses already have arbitrary string-keyed headers. Isn't that good enough? Why have an extra blessed "Status" key with special syntax? If there was a useful bit of information to convey (I also don't see any for 428), what's wrong with adding a new header?


You can see a very well compiled cheatsheet here: http://www.restapitutorial.com/httpstatuscodes.html


http://httpstatus.es

I'm bias as this is my site, but I prefer it because you can link to each code and it doesn't rely on javascript affects to display the data, also a memorable URL :-)


in case someone else is as dense as I am, apparently.. :)

the ones of mention are those that say '(draft)' after them: 428, 429, 431, 511


Ironically I'm not getting any HTTP code from this link... because the site is timing out.





Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: