javascript - express and fetch: TypeError: NetworkError 尝试获取资源时
问题描述
我正在使用 express、fetch 和 firefox。这是代码
async updateTutorial() {
const requestOptions = {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(this.currentTutorial)
};
await fetch("https://localhost:9000/tutorial/update" , requestOptions);
}
在 Firefox 中,我看到此错误:TypeError: NetworkError when trying to fetch resource 我不知道这是什么类型的问题。
解决方案
我用 div 替换了表单标签。现在没有错误。我忘了提到我得到了这个日志标记:
[HMR] Waiting for update signal from WDS...
推荐阅读
- python-3.x - 如何使用带有 locust 的 pythons 请求模块来加载测试一堆 api
- android - 我们可以更改 android PDFTRON 工具图标吗?
- java - 避免返回可写引用
- priority-web-sdk - 使用邮递员从 JSON 文件向表单插入多条记录
- java - 达到凭据列表的最大注册 sip 用户数时的错误代码
- cordova - 在 Cordova 项目中使用 WKWebView 插件不允许键盘显示 iOS 13 的焦点
- php - 在 Twig Extension 中获取当前模板文件名
- c - 有没有办法知道 AVL 树中的节点给节点级别
- python - 如何重用命令函数 discord.py
- jmeter - 如何保存表格数据,例如:最小值、最大值、平均值、90%、吞吐量等