rest - Correct http error about missing or invalid field in json body -


my rest endpoint consumes json fields. best http status error notify user field incorrect or missing?

i found info 422 unprocessable entity http://tools.ietf.org/html/rfc4918#section-11.2

the 422 (unprocessable entity) status code means server understands content type of request entity (hence 415(unsupported media type) status code inappropriate), , syntax of request entity correct (thus 400 (bad request) status code inappropriate) unable process contained instructions. example, error condition may occur if xml request body contains well-formed (i.e., syntactically correct), semantically erroneous, xml instructions.

is need or prefer status error?

based on description provide 422 code, sounds it's want.

for example, error condition may occur if xml request body contains well-formed (i.e., syntactically correct), semantically erroneous, xml instructions.

replace xml json in sentence, , there's answer!


Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

android - Associate same looper with different threads -

visual studio 2010 - Connect to informix database windows form application -