rest - Indicating Invalid Value with Reason -


i designing endpoint client hit register tenant application; these tenants represented subdomains (<subdomain>.alex.com). want reserve subdomains length <= 4 (for example can registered select clients). "right" http error code return user if choose subdomain <= 4 characters?

400 seems okay, wondering if there better.

one thought 422:

  422 unprocessable entity   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. 

the 422 code seems want do, consider 403, apply. prefer 403 on 422 couple of reasons, i.e. code definition 403 states automatic repeats shouldn't issued, or because more commonly used status code. opinion. in both cases think server should send message explaining problem, along status code.


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -