-
如果请求体的格式错误,比如使用了格式错误的 JSON ,这时,应该使用状态码 400
-
如果请求体的格式正确,但是其中的某个字段所包含数据由于业务逻辑而不能被使用时,比如不能使用已经存在的用户名,这时的状态码应该使用什么呢?
400: The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).
403: The server understood the request but refuses to authorize it.
疑惑点在:这种出于业务逻辑的原因而不能使用某个字段所包含的数据的情况,应该被归类于请求格式错误(400),还是拒绝响应(403)呢?
