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 來源:简书 简书著做权归做者全部,任何形式的转载都请联系做者得到受权并注明出处。
相关文章
相关标签/搜索