【发布时间】:2018-01-27 20:42:57
【问题描述】:
我正在尝试在 swagger 编辑器中运行我的 API。但是如果我在标头中传递oauth 令牌,它会给我一个错误,即不允许使用 405 方法。
另一件事是它在邮递员和终端中使用oauth 令牌完美运行。所以也许,问题在于招摇。
没有 oauth 令牌,它在 swagger 编辑器中完美运行。
如果没有在标头中传递 oauth 令牌,我的响应是
Request URL:http://172.168.1.28/crowdfunding_api/public/v1.0.1/categories
Request Method:GET
Status Code:200 OK
Remote Address:172.168.1.28:80
Referrer Policy:no-referrer-when-downgrade
并且 curl url 是响应为 200 时:
curl -X GET "http://172.168.1.28/crowdfunding_api/public/v1.0.1/categories" -H "accept: application/json"
在标头中使用 oauth 令牌我的响应是
Request URL:http://172.168.1.28/crowdfunding_api/public/v1.0.1/categories
Request Method:OPTIONS
Status Code:405 Method Not Allowed
Remote Address:172.168.1.28:80
Referrer Policy:no-referrer-when-downgrade
curl url 是响应为 405 时:
curl -X GET "http://172.168.1.28/crowdfunding_api/public/v1.0.1/categories" -H "accept: application/json" -H "authorization: 587ded3104e6ba7535642e6fcc217e7aa0f5f087"
【问题讨论】:
标签: rest oauth swagger access-token