1.Pre-request Script下配置时间格式:
postman.setGlobalVariable("maxBehotTime",Date.parse(new Date("2021/06/12 00:00:10")));
postman.setGlobalVariable("minBehotTime",Date.parse(new Date("2020/06/12 23:59:10")));

2.body — json参数设置,在这里引用上边定义的时间格式:
{
"maxBehotTime": {{maxBehotTime}},
"minBehotTime": {{minBehotTime}},
"size": 8,
"tag": ""
}

在Postman的Pre-requestScript中,配置了两个全局变量`maxBehotTime`和`minBehotTime`,分别用Date.parse方法解析2021年6月12日00:00:10和2020年6月12日23:59:10的日期。然后在请求Body的JSON参数中引用了这两个时间变量,同时包含`size`和`tag`字段。
1万+

被折叠的 条评论
为什么被折叠?



