【发布时间】:2017-05-04 19:32:13
【问题描述】:
我已将 JSON 文件导入邮递员,并且 JSON 正文正在请求特定参数的授权承载值。如何为参数设置值。目前它未定义。请参考以下 JSON 代码和图片。
"name": "Pos_TC-Name",
"event": [
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
"tests[\"Status code is 200\"] = responseCode.code === 200;"
]
}
}
],
"request": {
"url": "@987654321@",
"method": "GET",
"header": [
{
"key": "Content-Type",
"value": "application/json",
"description": ""
},
{
"key": "Authorization",
"value": "Bearer {{NurseAdminToken}}",
"description": ""
}
],
"body": {
"mode": "raw",
"raw": ""
},
"description": ""
},
"response": []
},
【问题讨论】:
-
您必须在
"Manage Environments"下将变量定义为global您单击窗口右上角的“设置轮”。
标签: json authorization access-token postman bearer-token