如何在 PostMan 中指定访问令牌
How to specify Access Token in PostMan
我已将 JSON 文件导入邮递员,JSON 正文正在请求特定参数的授权承载值。如何为参数设置值。目前未定义。请参考下面的 JSON 代码和图像。
"name": "Pos_TC-Name",
"event": [
{
"listen": "test",
"script":{
"type": "text/javascript",
"exec":[
"tests[\"状态码为 200\"] = responseCode.code === 200;"
]
}
}
],
"request":{
"url": "<a href="http://localhost:52586/api/Patient/7" rel="nofollow noreferrer">http://localhost:52586/api/Patient/7</a>",
"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
您单击 window 的 "Settings Wheel" 右上半部分。然后你 select/switch 到你定义全局的环境(设置轮旁边的下拉菜单)。
我已将 JSON 文件导入邮递员,JSON 正文正在请求特定参数的授权承载值。如何为参数设置值。目前未定义。请参考下面的 JSON 代码和图像。
"name": "Pos_TC-Name",
"event": [
{
"listen": "test",
"script":{
"type": "text/javascript",
"exec":[
"tests[\"状态码为 200\"] = responseCode.code === 200;"
]
}
}
],
"request":{
"url": "<a href="http://localhost:52586/api/Patient/7" rel="nofollow noreferrer">http://localhost:52586/api/Patient/7</a>",
"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
您单击 window 的 "Settings Wheel" 右上半部分。然后你 select/switch 到你定义全局的环境(设置轮旁边的下拉菜单)。