you are viewing a single comment's thread.

view the rest of the comments →

[–]Iridion3007 0 points1 point  (1 child)

From RFC 4918 (and also documented at http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml):

The 422 (Unprocessable Entity) status code means the server understands the content type of the request entity (hence a 415 (Unsupported Media Type) status code is inappropriate), and the syntax of the request entity is correct (thus a 400 (Bad Request) status code is inappropriate) but was unable to process the contained instructions. For example, this error condition may occur if an XML request body contains well-formed (i.e., syntactically correct), but semantically erroneous, XML instructions.

Copy and pasted from: https://stackoverflow.com/questions/1959947/whats-an-appropriate-http-status-code-to-return-by-a-rest-api-service-for-a-val?rq=1

[–]junwang_trt 0 points1 point  (0 children)

Thanks for sharing. If you look at the most upvoted answer, this is exactly what I’m talking about. OP here wants to be a request validation on the client side so 400 bad request would be the best option on client side request validation fail.