postman引入外部js文件

时间:2019-11-21 09:19:51   收藏:0   阅读:1782

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"));

原文:https://www.cnblogs.com/mobies/p/11902223.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!