如何生成身份验证承载令牌,该令牌将在性能测试脚本中使用。 我需要在Payment.sandbox的响应标头中传递令牌的动态值,braintree graphql请求。但我无处获得令牌的价值
请提供有关Jmeter工具或性能脚本的解决方案。 否则,如果需要一些代码行来生成令牌,或者需要使用beanshell sampler或jsr223,则请详细说明
预先感谢
答案 0 :(得分:0)
docs说:
然后,您将扩展Request标头以添加Authorization Bearer。这是一个TypeScript Apollo示例:
this.apollo.create({
cache: new InMemoryCache(),
link: new HttpLink(this.http).create({
uri: `https://${environment.braintree.url}`,
headers: new HttpHeaders().set('Authorization', `Bearer ${environment.braintree.token_key}`).set('Braintree-Version', `2020-06-21`)
})
}, 'braintree');