5 ms·
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 t
by ggchappell 14y ago
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?
- MichaelGG 14y agoWhy? 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 http://tools.ietf.org/html/draft-kaplan-sip-four-oh-00
- nickm12 14y ago> 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.
- asdfaoeu 14y agoPresumably 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.
- justincormack 14y agoYes but presumably the message will point to the API documentation page that explains this. It is a case of lost updates or this error.
- ggchappell 14y agoIndeed. 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.
- deleted 14y ago[deleted]
- snprbob86 14y agoThe 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?