3 ms·
> 400 Bad Request would have been entirely sufficient for this situation. The whole idea of status codes is that if you encounter one you don’t know about, you
by chrismorgan 6y ago
> 400 Bad Request would have been entirely sufficient for this situation.
The whole idea of status codes is that if you encounter one you don’t know about, you can treat it as a member of that family, so any unknown 4xx will be treated the same as a 400. Most of the 400 series is about clarifying what was wrong with the request. 400 just says something’s wrong about the request, but not what. 405 says it’s the method. 406 says it can’t satisfy the provided Accept header. 411 says it wants a Content-Length header. 418 says it’s that you tried to brew coffee in a teapot.
- Erlich_Bachman 6y ago> 418 says it’s that you tried to brew coffee in a teapot. That you tried to do something so absurdly inappropriate that there isn't even a proper technical way to explain why it was wrong and why it could not work? Like, the server could not even begin to understand what you tried to accomplish with that request.
- msla 6y ago> That you tried to do something so absurdly inappropriate that there isn't even a proper technical way to explain why it was wrong and why it could not work? Like, the server could not even begin to understand what you tried to accomplish with that request. The "Blank Stare" response code. Or maybe the "Stunned Stare And Slowly Backing Away" response code. Something at the other end: https://en.wikipedia.org/wiki/List_of_HTTP_status_codes https://en.wikipedia.org/wiki/List_of_HTTP_status_codes > 420 Enhance Your Calm (Twitter) >> Returned by version 1 of the Twitter Search and Trends API when the client is being rate limited; versions 1.1 and later use the 429 Too Many Requests response code instead.[74] The phrase "Enhance your calm" comes from the 1993 movie Demolition Man, and its association with this number is likely a reference to cannabis. Visually: https://http.cat/420 https://http.cat/420
- a1369209993 6y agoArguably that should be a 5xx response though; there's nothing wrong with the requests, the server just doesn't want to (doesn't have enough resources to) handle them as quickly as they're being issued.
- another-dave 6y agoI guess breaking the rate limit is a user error — e.g. sometimes if you continue with could get your access revoked. I read 50x as "something not your fault" went wrong.
- masklinn 6y agoYup. 500 errors are "the server is broken" (aka the server fails to fulfil the request), 400 errors are "the client did something it should not", including every case of "the client did something the server took issue with for whatever reason". In fact RFC 6585 added "429 Too Many Requests" specifically for rate-limiting scenarios. 413 (payload too large), 414 (URI too long) or 431 (header fields too large) are likewise things which may technically be valid according to the HTTP spec in general, but which the server rejects.