邮差中的持票人令牌

问题描述 投票:12回答:2

我想在邮递员中设置一个Bearer Token就像这样:

enter image description here

出于某种原因,我的邮递员在Auth下拉列表中没有Bearer Token选项:

enter image description here

我可以在Postman中做些什么来展示这个选项?有任何想法吗?问候。

postman
2个回答
29
投票

我不确定这两个图像是否来自同一个Postman应用程序,但是Bearer Token功能仅在版本5.3.0中出现。

您只需手动添加带有Authorization值的Bearer <my_token>请求标头即可。

这只是用于演示目的的虚拟值 - 实际值应为Bearer + your token value

Auth Header

这应该工作,而无需从下拉列表中使用该选项。这只会自动复制,无论如何你将手动做什么。


4
投票

我正在使用Postman v7.0.9。

将访问令牌变量添加到邮递员环境变量。

enter image description here

然后使用Tests选项卡编写javascript。

enter image description here

let jsonData = pm.response.json();
let token = jsonData.accessToken;
pm.environment.set('accessToken', token);

如果您使用的是当前版本的“Bearer Token”类型,则在“授权”选项卡下。

enter image description here


0
投票

我很久以前就遇到过这个问题。我通过安装桌面版本并再次使用Google帐户登录来解决了这个问题。之后,持票人令牌在邮差中可见!

就我而言,我使用的是Windows 8.1和64位。

here你可以得到桌面版


0
投票

您可以选择添加授权类型:

1)Go header tap并添加=> key:授权值:Bearer

2)创建集合>选择授权

3)单击代码并添加标题

enter image description here

headers:
{
  'Postman-Token': '55..',
  'cache-control': 'no-cache',
  'Authorization': 'Bearer eyJhbG...'
}
© www.soinside.com 2019 - 2024. All rights reserved.