postman中上一个接口返回值token传给下一个接口【关联接口】【多测师_王sir】

问题:

如何将A请求responseBody中的token传入B请求中的请求头中

把A请求中的token设置为环境变量,如下:

var data = JSON.parse(responseBody);
postman.setEnvironmentVariable("token", data.token);

注意:设置环境变量前,要先配置一个Environment

然后把B请求中的token的值参数化:token = {{token}}

 

原文地址:https://www.cnblogs.com/xiaoshubass/p/14126310.html