postman高级使用
1.全局函数设置和使用
设置:
使用:
2.获取时间戳毫秒|秒
毫秒:
pm.environment.set('timestamp',Math.round(new Date()/1));
秒:(带$表示postman自带变量具体查看官网,提供很多参数了)
"timestamp": "{{$timestamp}}",
3.预处理函数使用
console.log("--in--")
pm.environment.set('timestamp',Math.round(new Date()/1));//设置变量
var date = JSON.parse(request.data)//请求参数
console.log(date)//打印数据
var data = JSON.stringify(date)
console.log(data)
console.log("--en--")
3.Md5使用
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
THE END
二维码