Postman使用技巧之Authorization使用
Authorization設置位置:
postman里面的介紹:
The authorization header will be automatically generated when you send the request. Learn more about authorization
授權頭將在發送請求時自動生成。了解有關授權的更多信息:https://learning.postman.com/docs/sending-requests/authorization/
例如basic-auth格式的:https://learning.postman.com/docs/sending-requests/authorization/#basic-auth
Basic auth
Basic authentication involves sending a verified username and password with your request. In the request Authorization tab, select Basic Auth from the Type dropdown list.
Enter your API login details in the Username and Password fields—for additional security you can store these in variables.
In the request Headers, you will see that the Authorization header is going to pass the API a Base64 encoded string representing your username and password values, appended to the text "Basic " as follows:
Basic <Base64 encoded username and password>理解
即Authorization中的信息被被自動拼接到head中格式為:'Basic ’ 加上 'Username:Password’轉成Base_64 的字符串。(注意Basic 后面有個空格)
Authorization = 'Basic '+'Username:Password':Base_64案例
填寫Username、Password后會自動添加到請求頭中。
案例中的編碼轉換:
拓展
js實現基于Base64的編碼及解碼:https://blog.csdn.net/weixin_42420703/article/details/81384901
用JS進行Base64編碼、解碼:https://www.jianshu.com/p/14437764eff3
總結
以上是生活随笔為你收集整理的Postman使用技巧之Authorization使用的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: oracle 计算时间差 毫秒,Orac
- 下一篇: Process finished wit