![](/img/trans.png)
[英]How to fetch data from nested JSON response and pass to next request in postman?
[英]How to pass the first JSON response in the next request's endpoint (Postman)
我的第一个请求中包含以下响应正文:
{
“resource-id”: “abcd-22-sxww”
}
我需要在下一个请求端点中使用上述“ resource-id”的值(每隔几分钟更改一次,并且不是恒定的):{{url}} / abcd-22-sxww / END-POINT
有什么建议么?
pm.environment.set("resource-id", resourceid);
然后,在另一个:
const resourceid = pm.environment.get("resource-id");
或使用端点URL中的密钥:
{{resourceId}}
注意:已更新以反映评论的反馈。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.