日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Postman使用技巧之Authorization使用

發布時間:2023/12/20 编程问答 36 豆豆
生活随笔 收集整理的這篇文章主要介紹了 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后會自動添加到請求頭中。


案例中的編碼轉換:

window.btoa('RFC_DMS_PO:D202110MS')//編碼 window.atob("UkZDX0RNU19QTzpEMjAyMTEwTVM=") // 解碼


拓展

js實現基于Base64的編碼及解碼:https://blog.csdn.net/weixin_42420703/article/details/81384901
用JS進行Base64編碼、解碼:https://www.jianshu.com/p/14437764eff3

總結

以上是生活随笔為你收集整理的Postman使用技巧之Authorization使用的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。