【发布时间】:2015-05-05 05:11:37
【问题描述】:
我正在构建一个 REST API,但我很困惑我应该为以下情况抛出什么错误。
Rest API 网址是,
https://myapp.com/users/search?q=<search_query>&access_token=<token>&user_type=<type>
在上述端点中,user_type 参数具有有效值“admin”和“standard”。如果我得到其他值而不是 'admin' 或 'standard' 我应该抛出什么 http 错误?
它应该是 400 Bad Request 或 404 Not Found。
【问题讨论】:
标签: web-services api rest https