Skip to content

在 Tests 脚本中设置变量

js
if (pm.response.code === 200) {
  const response = JSON.parse(pm.response.text());
  if (response.data.access_token) {
    pm.environment.set('access_token', response.data.access_token);
  }
}

file

Released under the MIT License.