Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> 422: Unprocessable Content

I honestly would have thought 400 Bad Request would cover that? Might be too generic though. Is "422" "ok, I admit it's formatted correctly, but I can't process it for some higher-level reason than syntax"?

(Just reading through 4xx codes, and I think I need to use 410 Gone a lot more often. Does anyone know if search engines treat 404 and 410 differently?)



The issue I have with 400 Bad Request is that it's very broad. The request might actually be fine, but the data posted is not. Now you could argue that it doesn't matter why the request is bad, formatting, protocol or data, 400 for everything. It just feels a lot like throwing a generic Exception and attempting to convey the details in the message body.


From personal experience search engines don’t honor 404 or 410. I switched much of my personal site to returning 410 over a decade ago and Googlebot still returns on a routine basis re-requesting a document that hasn’t been on the site since 2012.


Well... a thorough "meh" to Google. Thanks for the info though, one less thing for me to care about.


Out of paranoia I just checked and yeah, GoogleBot actual (and not the dozens of fakes) requested each 410'd URL at least once a month, some URLs get multiple requests per month. All have been marked 410 since 2014 or earlier.


Google has FoMO...


The webmaster tools used to say Google will punish your rank if the crawler gets too many 404 or 410...


> Is "422" "ok, I admit it's formatted correctly, but I can't process it for some higher-level reason than syntax"?

That is my understanding. Something to say that the request is understood as an HTTP request (therefore not 400) but the server doesn't know what to do with it, usually in the context of a POST, or it's otherwise invalid for processing.


410 could be useful if you want to make sure that the client does not confuse a “real” 404 with a gateway issue.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: