Postman是一个API开发协作平台,功能十分强大,一般拿来做一个API的接口测试,目前已经独立出chrome,有了自己的独立软件,官方也是推荐不要再使用旧版平台。某次升级后发现我最喜爱的记录请求历史功能不见了,作为web开发你要模拟一个登陆,以及一些复杂入参,我们希望能够拿个页面上的请求改改,所以为了实现旧版一样的功能,按以下操作安装即可。

安装Postman for Windows

下载地址: https://www.postman.com/downloads/

直接下载最新版即可。

安装 Postman Interceptor

如果你可以上外网,那么可以直接通过访问跳转到官方商店安装,如果不行的话通过插件网站下载crx再拖进浏览器安装。

安装Interceptor Bridge

同样如果你可以上网直接通过Postman软件直接安装见:https://learning.postman.com/docs/postman/sending-api-requests/interceptor/

如果你跟我一样 这么不巧没办法在云桌面里上网,那就整个离线版再安装:

Mac
windows
Linux

解压,阅读里面的ReadMe:

Installation Guide

  • Double click on install_host.bat to install the Native Messaging host for Interceptor <> Postman App Integration.
  • This script installs the native messaging host for the current user by creating a registry key at HKCU\Software\Google\Chrome\NativeMessagingHosts\com.postman.postmanapp and setting its default path the full path to com.postman.postmanapp.json. Learn more.
  • Once installed, you'll need to restart Chrome for the changes to take effect

如果windows安装不生效尝试以管理员身份运行。

请务必确保chrome插件安装的id与interceptorBridge的com.postman.postmanapp.json中的id一致,否则无法成功关联!

chrome安装的id
chrome安装的id

interceptorBridge配置文件的id
interceptorBridge配置文件的id

至此安装完成,你可以跟以前旧版本一样拦截请求,在测试web相关的接口的时候在Postman里只需要改改拦截到的请求url或者请求体再请求即可,可以说非常nice!