【发布时间】:2021-08-07 20:05:32
【问题描述】:
在 Postman 中,我运行一个任意请求。我将以下代码放入 Pre-req. 脚本或在 Tests 脚本中:
fetch('https://jsonplaceholder.typicode.com/todos/3')
.then(response => response.text())
.then(responseBody => {
console.log('The response body:');
console.log(responseBody);
});
当我点击 Send 按钮运行请求时,我得到 ReferenceError: fetch 未定义:
在线搜索时,我几乎没有找到有关此错误消息的任何信息 在邮递员。 现在,Postman 并不是一般意义上的网络浏览器,而是几乎所有 well known web browser offers the Fetch API 这些天。
Postman 没有实现 Fetch API 吗?
【问题讨论】:
标签: javascript asynchronous fetch postman