HTTP 400 (bad request) for logical error, not malformed request syntax

后端 未结 8 1005
生来不讨喜
生来不讨喜 2020-12-02 09:11

The HTTP/1.1 specification (RFC 2616) has the following to say on the meaning of status code 400, Bad Request (§10.4.1):

The request could not be unde

8条回答
  •  Happy的楠姐
    2020-12-02 09:35

    Status 422 (RFC 4918, Section 11.2) comes to mind:

    The 422 (Unprocessable Entity) status code means the server understands the content type of the request entity (hence a 415(Unsupported Media Type) status code is inappropriate), and the syntax of the request entity is correct (thus a 400 (Bad Request) status code is inappropriate) but was unable to process the contained instructions. For example, this error condition may occur if an XML request body contains well-formed (i.e., syntactically correct), but semantically erroneous, XML instructions.

提交回复
热议问题