我已将一个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": []
},
答案 0 :(得分:1)
您必须在global
下将变量定义为Manage Environments
您点击窗口右上角的“设置轮”。然后选择/切换到定义全局的环境(设置轮旁边的下拉菜单)。