Postman Pre-request

## Postman 脚本处理发送参数

pre-request

let openDomain = pm.environment.get("openApiDomain");
let url = openDomain + "/test/open_sign";

let request11 = pm.request.clone();
request11.url = url;

pm.sendRequest(request11, function (err, response) {
    let res = response.json();
    if (res.code == 0) {
        pm.request.body.update({
            mode: 'raw',
            raw: JSON.stringify(res.data.params),
            options: {
                raw: {
                    language: 'json'
                }
            }
        });
    }
});

参考资料 Postman JavaScript reference | Postman Learning Center

 

上一篇:postman 高级


下一篇:9组-Beta冲刺-2/5