8 ms·
New HTTP Codes
- rwolf 15y agoToday I learned about If-Match. 428 Precondition Required looks great!
- pavpanchekha 15y agoThese all seem immediately practical status codes that add semantics I've been wanting. Great! In particular I am happy about the 429 Too Many Requests header, as every time I've done rate throttling I've had to quibble over what code to actually send back.
- simondlr 15y agoYeah. This is great. Will work great with APIs.
- deleted 15y ago[deleted]
- i386 15y agoWhat code did you use? I've typically used a 408 in a throttling use case but it never seemed to fit well (our client handled this response from our server with an exponential back off so we were not relying on another client to handle it correctly).
- caf 15y ago503 seems the most appropriate of the current codes ("The server is currently unable to handle the request due to a temporary overloading or maintenance of the server. The implication is that this is a temporary condition which will be alleviated after some delay.")
- catwell 15y agoTwitter uses "420 Enhance Your Calm" (...) A new error code is definitely needed.
- marcomonteiro 15y agoThis made me lol...literally!
- antimora 15y agoI wish HTTP requests submitted time zone information.
- mooism2 15y agoJust the current offset from UTC, or including the whole daylight savings malarkey?
- AndrewDucker 15y agoThe actual Timezone would be great (something like Europe/London, etc.) Using the same format as the tz database: http://en.wikipedia.org/wiki/Tz_database#Names_of_time_zones http://en.wikipedia.org/wiki/Tz_database#Names_of_time_zones
- mooism2 15y agoI suppose now ICANN maintain it, it makes it easier for it to become an internet standard.
- klodolph 15y agoYou can get the offset with JavaScript, at least.
- zb 15y agoIt has been proposed several times. 2008: http://tools.ietf.org/html/draft-sharhalakis-httptz-05 http://tools.ietf.org/html/draft-sharhalakis-httptz-05 1995 - shot down because (paraphrasing) "I don't need this so neither should you": http://www.hpl.hp.com/personal/ange/archives/archives-95/http-wg-archive/0521.html http://www.hpl.hp.com/personal/ange/archives/archives-95/htt... The general consensus seems to be that since this can never be all things to all people, we can't ever implement it. To me it seems like this is crying out for a Worse is Better solution.
- mnot 15y agoI think we'll see this discussion come around again soon; maybe it'll stick this time.
- ck2 15y agoSummary: 428 Precondition Required 429 Too Many Requests 431 Request Header Fields Too Large 511 Network Authentication Required I've been using 414 Request-URI Too Long for 431 and 503 Service Temporarily Unavailable for 429
- ra 15y agoApart from the obvious semantics, what's the difference between 428 and 412? (412 - precondition failed)
- jsn 15y agoAFAICS, 412 is only meaningful when the request did specify a precondition (which failed), while 428 means that the request didn't specify some precondition (which was required by server).
- IsaacSchlueter 15y ago"Apart from the semantics", the difference is 16.
- Robin_Message 15y ago511 seems a little pointless -- browsers can treat it differently, but if the intermediate gateway intends to be malicious, then it won't return 511 anyway. The only useful thing I can see is avoiding accidents/attacks on the gateway compromising its clients.
- bostonvaulter2 15y agoI don't think 511 is so much for security, I see it as being more focused on usability. For example if you have thick client program that talks to a backend server (perhaps for updates) and it receives a 511 response it can then tell the user that they need to login to the proxy (or just pop up a web browser for them).
- objclxt 15y agoExactly: a good example is how OS X currently works - everytime you connect to a new WiFi hotspot it fires a request to a static page on Apple's server in the background, to determine whether or not you have to sign in. If it detects unexpected content it assumes it's a sign-in page for a WiFi hotspot, and presents it modally. Under this proposed system the OS can simply check for an appropriate HTTP response code, which makes life a little easier.
- RyanKearney 15y agoWindows does this too.
- rmc 15y ago511 is aimed for the wifi networks that you find in hotels & airports where you have to pay money for access, or create an account.
- yxhuvud 15y agoIndeed. It will be very nice to not return a 403.
- stygianguest 15y agoA bit offtopic, but does anybody know what typesetting system was used to produce this document? It looks like troff manpages. Is that what is used for RFC documents as well? I love the oldschool look of it.
- rev087 15y agoNothing special, it`s just your browser's default monospaced font.
- p4bl0 15y agoIt was created using rfcmarkup[1], a tool made by the ietf. A quick look at the source of the page in the "generator" meta tag would have told you that (that's how I just found out) :-). [1] https://tools.ietf.org/tools/rfcmarkup/ https://tools.ietf.org/tools/rfcmarkup/
- km3k 15y agoYes, all RFC documents use this style. You can find more at http://www.rfc-editor.org/rfc.html http://www.rfc-editor.org/rfc.html
- adulau 15y agoYou have different tools to write RFC-like documents. One of the most common one used is xml2rfc (http://xml.resource.org/ http://xml.resource.org/) but there is also rst2rfc (http://code.google.com/p/rst2rfc/ http://code.google.com/p/rst2rfc/).
- worldimperator 15y agoCan't wait to set browser dependent status codes :-D
- dochtman 15y agoWhat happened to 430?
- billpg 15y agoShouldn't 429 (Too many requests) be a 5xx code?
- moserware 15y agoI think it's fine. 4xx is a way of saying the client did something wrong that it can potentially fix (i.e. slow down requests). 5xx is more opaque meaning there is nothing the client can do to fix the problem.
- snorkel 15y agoIn general 4xx errors are problems with the request, and 5xx errors are operational issues with the server/network
- bromagosa 15y agoOMG really? Do we want to make HTTP even bigger? Don't we want to dump it for good and look for something more suitable to what the modern web needs instead?
- gujk 15y agoWhat do you propose we do in he meantime, before all the existing servers and clients are migrated?
- uriel 15y agoI propose HTTP 0.2, a subset of HTTP 1.1 with some simple extensions: http://http02.cat-v.org http://http02.cat-v.org
- Hoff 15y agoRewriting a large and complex enterprise-class application is tough enough, and a task that can variously (and expensively) fail. Rewriting the whole of the World Wide Web? Your replacement had better have a solid compatibility and migration path with "legacy" HTTP, and provide a substantial improvement over what HTTP and the existing tools provides, and clients and a migration path for a majority of the platforms and tools and browsers and embedded browsers and embedded web servers in use, and the budget and the time to make the replacement push.
- sanxiyn 15y agoGoogle is trying: http://www.chromium.org/spdy http://www.chromium.org/spdy
- stanleydrew 15y agoSPDY isn't really intended to replace HTTP I don't think, it's just speeding it up quite a bit. All the messages exchanged between client and server are still HTTP when using SPDY.
- 15y ago
- deleted 15y ago[deleted]
- afdssfda 15y ago511: 'Unknown clients then have all traffic blocked, except for that on TCP port 80, which is sent to a HTTP server (the "login server") dedicated to "logging in" unknown clients, and of course traffic to the login server itself.' Ugh. Couldn't this be more generic?
- gwillen 15y agoThat section is descriptive of current practice. The semantics of 511 are the previous section.
- otherports 15y agoAgreed. Is the login server not allowed to run on port 443? Is it not permissible to redirect HTTP traffic on other ports such as 8080 and 9006?
- aninteger 15y agoIsn't this something that the http server handles? I am not in web development except for basic php and cgi scripts. Are people actually writing web app code to dictate what http code comes back on each request?
- politician 15y agoYes, sometimes the correct response is not an HTML page, but an error code (e.g. 301 Moved Permanently, 302 Found are used to implement redirects).
- ataggart 15y agoAnd sometimes the correct response is an error code and an HTML page, e.g., 401 Unauthorized and an ajax login page that reloads the current URL.
- vdm 15y agoA correct response code is the minimum to play nice, and a body, HTML or otherwise, is courteous. They are not mutually exclusive. http://php.net/manual/en/function.header.php http://php.net/manual/en/function.header.php http://docstore.mik.ua/orelly/linux/cgi/ch03_03.htm#ch03-9-fm2xml http://docstore.mik.ua/orelly/linux/cgi/ch03_03.htm#ch03-9-f...
- mikeryan 15y agoYou see more explicit use of http status codes in web service (data) API's particularly ones using REST.
- netghost 15y ago429 Too Many Requests is really great for APIs, hopefully http clients start supporting this.
- a5seo 15y ago428 seems interesting as a way to serialize objects and store them client-side, but assure the version stays consistent with the server. Or am I overthinking it?
- ericmoritz 15y agoWhelp I guess this needs updating now, https://github.com/basho/webmachine/raw/master/docs/http-headers-status-v3.png https://github.com/basho/webmachine/raw/master/docs/http-hea...
- edoloughlin 15y agoOne quibble. Perhaps I don't quite get the philosophy behind these, but wouldn't it be more useful to have a uniform structure to the responses. E.g., how useful is it to the average user to get a human-readable response for 428 when it's likely to be consumed by an app (i.e., JS) which would have to parse the suggested <p> tag?
- johns 15y agoYou can return any content type you want and you should use content negotiation to return the type the client is expecting. The HTML descriptions are only suggestions.
- afhof 15y ago429 looks to me as if it might be addressing aggressive http pipelining, but I was under the impression that most browsers have pipelining turned off.
- _pdeschen 15y agoBoth Firefox and opera offer pipelining while it is deactivated on chrome (next release will have it on by default).
- textgoeshere 15y agoCan I start using any of these codes right now? It looks like this is still a draft. Thanks!