gpt4 book ai didi

javascript - 评估预请求脚本时出错

转载 作者:行者123 更新时间:2023-12-01 15:06:17 24 4
gpt4 key购买 nike

我正在尝试通过 Post Request Script 在 Postman 中访问我的 POST 请求的响应。

我在 Pre-request Script 下添加了这两行

let response = pm.response.json(); 
console.log('JSON Response: ',response );

然后,在点击 Send 之前,我打开了我的 Postman 控制台。发出我的 POST 请求

我不断得到

There was an error in evaluating the Pre-request Script: TypeError: Cannot read property 'json' of undefined



我需要在 Postman 上启用任何功能吗?

最佳答案

在发送请求之前运行预请求脚本。您还没有回复。

尝试将您的脚本放在 Tests 下选项卡,在收到响应后运行。

关于javascript - 评估预请求脚本时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48429643/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com