Right HTTP status code to wrong input

前端 未结 6 1295
隐瞒了意图╮
隐瞒了意图╮ 2020-12-12 11:58

What is optimal HTTP response Code when not reporting 200 (everything OK) but error in input?

Like, you submit some data to server, and it will response that your da

6条回答
  •  一生所求
    2020-12-12 12:26

    Codes starting with 4 (4xx) are meant for client errors. Maybe 400 (Bad Request) could be suitable to this case? Definition in http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html says:

    "The request could not be understood by the server due to malformed syntax. The client SHOULD NOT repeat the request without modifications. "

提交回复
热议问题