brookshi / Hitchhiker

a Restful Api test tool
http://www.hitchhiker-api.com
Other
2.19k stars 402 forks source link

Authorization的type分别为Basic Auth和Bearer Token时,token在哪个地方添加 #240

Open and015 opened 6 years ago

and015 commented 6 years ago

尝试在Headers中的Authorization和Cookie中添加token,但send之后出现如下情况 { "code": 401, "message": "access token unauthorized" }

brookshi commented 6 years ago

Authorization是加在header里的,当然,需要是编码后的。 参考: https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Authentication

and015 commented 6 years ago

感谢 API测试终于可以继续下去了

and015 commented 6 years ago

当type为Basic时,在header中添加Authorization : Basic base64(用户名:密码) ,状态码显示的是 { "code": 401, "message": "wrong basic token" } 当type为Bearer时,在header中添加Authorization : Bearer token 不知道这样对不对?

brookshi commented 6 years ago

就我了解的,是这样没错。

and015 commented 6 years ago

当type为Basic时,经过实际操作,hitchhiker不支持base64编码,希望能有进一步的优化措施。

brookshi commented 6 years ago

放在header里的东西当然不能做任何处理了,需要自己编码或用脚本处理。 至于Auth,以后会做和postman一样的基于UI的

and015 commented 6 years ago

噢噢 期待中。。。