api - HTTP code best suited in case of databse delete restriction due to dependency -


in api response http code best describes case of request failure result of database delete restriction due dependency.

422 best response, reasons explained here: https://stackoverflow.com/a/9132152/18706

from webdav standard:

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.

that it's delete request opposed or other, doesn't matter when request semantically invalid.

if don't want use webdav extension, 400 closest thing, it's not quite same implies syntax problem request.


Comments

Popular posts from this blog

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

python - Mongodb How to add addtional information when aggregating? -

java - Incorrect order of records in M-M relationship in hibernate -