接口測試--postman interceptor插件

使用portman 模擬請求,一直不成功,出現如下所示
這裏寫圖片描述

之後開啓了postman interceptor插件,如圖
這裏寫圖片描述

那麼,postman interceptor 到底是起什麼作用的,爲什麼開啓了它就成功了呢? 詢問了一下度娘:

Postman Interceptor的主要功能:

  • 記錄瀏覽器請求並直接導入到Postman
  • 可添加Filter,對瀏覽器中的請求進行過濾

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。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章