REST API Framework. Recommended behavior for invalid querystring parameter

前端 未结 2 1639
清酒与你
清酒与你 2020-12-29 07:45

I am implementing a REST API Framework, and I wonder what the recommendedbehavior is, when a client submits an invalid querystring parameter.

I will illustrate what

2条回答
  •  独厮守ぢ
    2020-12-29 08:14

    Following the letter of the law, the response should be a 404 Not found. However, nobody is going to get too upset with you if you prefer to return 400 - bad request.

    I would definitely return a 4XX status code though. You want the client to know that they made an error.

提交回复
热议问题