如何在PostMan中指定访问令牌

时间:2017-05-04 11:16:15

标签: json authorization access-token postman bearer-token

我已将一个JSON文件导入邮递员,而JSON Body正在为特定参数请求授权承载值。如何为参数设置值。目前尚未定义。请参考以下JSON代码和图像。

"name": "Pos_TC-Name", "event": [ { "listen": "test", "script": { "type": "text/javascript", "exec": [ "tests[\"Status code is 200\"] = responseCode.code === 200;" ] } } ], "request": { "url": "http://localhost:52586/api/Patient/7", "method": "GET", "header": [ { "key": "Content-Type", "value": "application/json", "description": "" }, { "key": "Authorization", "value": "Bearer {{NurseAdminToken}}", "description": "" } ], "body": { "mode": "raw", "raw": "" }, "description": "" }, "response": [] },

Issue

1 个答案:

答案 0 :(得分:1)

您必须在global下将变量定义为Manage Environments您点击窗口右上角的“设置轮”。然后选择/切换到定义全局的环境(设置轮旁边的下拉菜单)。