ember.js - REST-API HTTP status code for invalid input on a Patch request -
there patch request on application updates user's password. have ember validator block invalid input except 1 business rule, should not password used 1 of past 5 passwords.
we returning 400 bad request in case, company has dashboard component availability , counts 400 , 500 requests unavailability, because applications soap , expect 200 , 300s. though handle 400 appropriately through ui still ding against us. , puts on radar area poor availability.
should take people monitor availability , have them change rest services become more common , common occurrence company creates more rest applications. or cave , return 200 states password not updated?
i argue 400 response inappropriate service. if service responding 400 when user's password has been repeated within last 5 passwords, request was understood server.
according w3c:
the request not understood server due malformed syntax. client should not repeat request without modifications.
in case, request understood. returning 400 signal application concern (regarding password reuse). believe 200 response more appropriate payload indicating application problem.
edit: 1 might argue 422 response in order:
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.
Comments
Post a Comment