postman安裝Postman Interceptor 插件

作後端開發避免不了進行接口調試,可是通常的項目都是先後端分離的,若是把前端代碼下到本地,較爲費事,這個時候就須要一個能夠進行接口調試的工具。Postman就是一個不錯的選擇。
Postman是什麼?
    Postman是一種網頁調試與發送網頁http請求的chrome插件。咱們能夠用來很方便的模擬get或者post或者其餘方式的請求來調試接口。
怎樣使用?
    使用Postman若是經過本身拼接url,本身造數據,是很是麻煩的。所以選擇Postman+Postman interceptor,使用Postman interceptor能夠攔截到網頁請求,同時傳到postman的history列表中,而後咱們只須要在postman中修改一下url就能夠直接send了。

後來通過仔細對比研究發現,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插件幾乎在這個網站上都能找到。

做者:xiaolanzi007 連接:https://www.jianshu.com/p/da09e1f399c7 來源:簡書 簡書著做權歸做者全部,任何形式的轉載都請聯繫做者得到受權並註明出處。
相關文章
相關標籤/搜索