使用 POSTMAN REST 客户端从用户登录 session 的响应中获取“SessionId”。
GET请求的其他API调用如何使用sessionId?
最佳答案
对您的数据结构做出一些假设,将其存储为变量:
//parse the response body as JSON
var data = JSON.parse(responseBody);
//create a global variable that can be reused in another call
postman.setGlobalVariable("sessionId", data.SessionId")
在调用另一个端点时使用:
http://www.example.com/ {{sessionId}}
关于api - 如何使用 PostMan Rest 客户端使用 SessionID,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30192220/