【发布时间】:2020-04-11 17:25:25
【问题描述】:
我正在为 API 与我们的服务集成之一创建邮递员集合。这里我们使用 OAuth1.0 进行身份验证。我想将 oauth 初始化响应 oauth_token、oauth_token_secret 设置为邮递员环境变量,以便我可以在进一步的请求中访问它们。 响应采用以下格式而不是 JSON。 oauth_token=oauth_token_value&oauth_token_secret=oauth_token_secret_value&oauth_callback_confirmed=true
我试过下面的脚本:
var output = require('querystring').parse(Response.text);
postman.setGlobalVariable("oauth_token", output.oauth_token);
postman.setGlobalVariable("oauth_token_secret", output.oauth_token_secret);
请有人帮我将令牌设置为邮递员环境变量。
注意:我使用的是 chrome 插件版本 5.5.4,而不是原生应用。
【问题讨论】:
-
使用原生应用。
标签: postman