What HTTP status response code should I use if the request is missing a required parameter?

后端 未结 9 1955
心在旅途
心在旅途 2020-11-28 01:15

I am thinking 412 (Precondition Failed) but there may be a better standard?

9条回答
  •  温柔的废话
    2020-11-28 01:26

    I Usually go for 422 (Unprocessable entity) if something in the required parameters didn't match what the API endpoint required (like a too short password) but for a missing parameter i would go for 406 (Unacceptable).

提交回复
热议问题