后来通过仔细对比研究发现,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插件几乎在这个网站上都能找到。