繁体   English   中英

如何在下一个请求的端点(邮递员)中传递第一个JSON响应

[英]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}}

https://learning.getpostman.com/docs/postman/scripts/postman_sandbox/#environment-and-global-variables

注意:已更新以反映评论的反馈。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM