当前位置: 首页>大数据>正文

Postman验证码接口可视化

Postman版本(macOS):


Postman验证码接口可视化,第1张
Postman版本.png

验证码接口:


Postman验证码接口可视化,第2张
验证码接口.png

接口响应数据格式:

{
    "uuid": "code-key:c3b767002a3e4408b1cf566922653f5c",
    "img": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHMAAAAmCAIAAAB4YjP1AAAMPklEQVR42u2ae1BU1x3HfSVNmyaZTDPTdqZt2nTaaadNmwwQax2V+IiSTqLRaibWZxIRRQ34iFHBWFGioqAiIMhTkEWQN4sgzwWB8GZ5LFmey2OFZWGXXXZ57LKc/g7ncu9d9u4uSB79gzNnnN1zL7D3s7/7Pd/v77oAzY/J0TIwcL2k5EBa2nvR0dvi4q4VF3eqVHP5hQvmmY4bDOHV1WsiIiKFwnalUqpWF3Z0+JaWrggNDamqmif79MNDIHBMTZVpNNPWgTIUb1Jj4zzZpxkVUilUq3JkhPMowIWjUMXzZGc9jmVmxotEFk7wLy+HOU921gPEFPYuyzuby8OH3ybZYT2q7kXZ7ehhK6qR4bf/P2NCrx9ualKVlMC/c/xVNoGBlk8A/XWIijJakssRiG9dHWprQzrdTMk2K5B7AXojFC26hBZ8xcznvND6GMQTofGJp7yGUc3A3JlqhMLWEyeqVqyosLEhszciYi6/cBOPNzY+buGE0u7uLffv41daLeLzkZsbcnRk5sGDKDgYyWRWyPpXoYVfGQE1na8FoILOWRXYhLgkItV79d3jP6/P9TV3lsGgr8+7VZrwhW6Ee7vQK5UtJ07QQOlZuWzZGNeFzXB8npWVA6VnfoDxAvOAGhrQsWNGTNnT2RmVlVkie68Bs3PJRrkSJBlEihE0Oo5G9KhFiWIb0cYHFPfFl1CocEafe2RInn7TIdBxAZlBTou7RVmmp6lkzQmeduSchIu2pnDhrheuX09Qih0d++LiRtraat99l6wMZGQ8Ndniri6IBlozNzVIgX1YWHdxMXJywgSPHEEJCailBYMGqwuCkJmJXF3xof378aI5svVyDG53GkptxjOpCSMGrPSAt89fpeB+LbXy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m7VpQ2LpNm8Az6BWKH/L/6kDZpqbiXhcU7/HjqLp6Fhlsfjz1mCc7T3ae7PyYJ/vdjv8BR1GMZlWX3t8AAAAASUVORK5CYII=",
    "codeEnable": true
}

在Tests中写后置JS脚本:

// 取出响应请求体
var body = pm.response.json();
// 取出验证码编号 并写入环境变量 供后面的接口使用
var uuid = body.uuid;
pm.environment.set("uuid", uuid);

var data = {
    response: pm.response.json()
}
// 构造一个简易的html页面
var template = `<html><img src="{{response.img}}" /></html>`;
// 点击Visuzlize查看验证码图片
pm.visualizer.set(template, data);

点击Visualize查看构造的html页面:


Postman验证码接口可视化,第3张
Visualize.png

https://www.xamrdz.com/bigdata/7zw1994820.html

相关文章: