在 postman 的 pre-request script 发送 GET 请求

在 postman 的 pre-request script 发送 GET 请求

const options = {
  'method': 'GET',
  'url': 'https://httpbin.org/uuid',
  'header': {
    'Foo': 'bar'
  }
};


pm.sendRequest(options, function (err, response) {
    const data = response.json()
    pm.globals.set("uuid", data.uuid);
});

 

posted @ 2020-02-02 14:06  jameslailai  阅读(329)  评论(0)    收藏  举报