postman引入外部js文件
1、启动tomcat,确定路径:http://localhost:8080/d/forgeJS.js
2、postman Pre-request Script
console.log(pm.environment.get("variable_key1"));
if(!pm.globals.has("forgeJS")){
pm.sendRequest('http://localhost:8080/d/forgeJS.js', function (err, res) {
if (err) {
console.log(err);}
else {
pm.globals.set("forgeJS", res.text());}
})}
eval(postman.getGlobalVariable("forgeJS"));