我尝试在请求中包含我能找到的所有内容,但是错误仍然存在。我要怎么找出是什么原因造成的?我的AdBlocker扩展已被停用。
await fetch('http://127.0.0.1:8080/hxo.json?dummy=2s21',
{headers: {'Content-Type': 'application/json; charset=UTF-8'},
cache: "no-store",
pragma: 'no-cache'})
.then(resp => resp.json())
.then(data => console.log(data))
.catch(err => console.error('problem w fetch: ', err))

发布于 2022-02-17 12:44:34
添加method和删除Pragma属性可以解决这个问题
fetch('url',
method: 'GET',
{headers: {'Content-Type': "application/json"}
})https://stackoverflow.com/questions/71157855
复制相似问题