後來通過仔細對比研究發現,postman有一個chrome插件 Postman Interceptor,可讓postman中發送請求的時候使用這個網站的瀏覽器cookie。我同事用了這個插件,發送請求的時候帶上了本身的cookie,因此才能訪問。html
因而仔細研究了一下這款chrome Postman Intercepto插件。前端
Postman Interceptor的主要功能chrome
記錄瀏覽器請求並直接導入到Postman後端
可添加Filter,對瀏覽器中的請求進行過濾瀏覽器
如何安裝Postman Interceptor?cookie
1. 下載Postman Intercepter chrome插件,其格式是一個crx文件。前後端分離
2. 在谷歌中打開:chrome://extensions/工具
3. 拖動crx文件到chrome://extensions/頁面。post
4. 在「要添加‘Postman interceptor’嗎」對話框上點擊「添加擴展程序」。測試
5. 而後就能夠看到瀏覽器右上角的postman interceptor 工具圖標
Postman Intercepter使用方法
1.在Postman工具中打開postman Intercepter功能
2. 若是隻須要測試特定網站,能夠在 postman interceptor插件中設置 Filter requests。
Filter requests默認是「.*」,表示捕獲全部的網站。若是隻想要捕獲百度,能夠在Filter requests裏輸入「baidu」。
3. 在chrome中進行操做,好比打開百度,而後搜索關鍵字「hello」,而後點擊「百度一下」。
4. 打開 postman interceptor。能夠看到 「last 10 requests「。
5. 打開Postman,能夠看到「History」顯示chrome中進行的操做。
6. 而後就能夠在Postman對 request進行修改,過濾,以及編寫測試。
Postman Interceptor,可讓postman中發送請求的時候使用這個網站的瀏覽器cookie。發送請求的時候帶上了本身的cookie,若是在嘗試獲取數據時不能訪問,能夠考慮Postman Interceptor。
這款插件的下載地址:http://www.cnplugins.com/devtool/postman-interceptor/download.html
也發了一個很好的chrome插件網,chrome插件幾乎在這個網站上都能找到。