Javascript VM836 test.js:52未捕获(承诺中)语法错误:意外标记<;在JSON中的位置0。为什么?
我正在使用下面的代码,但是我得到了错误“位置0处的JSON中的意外标记<”为什么我得到了它,我如何修复它Javascript VM836 test.js:52未捕获(承诺中)语法错误:意外标记<;在JSON中的位置0。为什么?,javascript,json,Javascript,Json,我正在使用下面的代码,但是我得到了错误“位置0处的JSON中的意外标记
async function sendURL(urls) {
const res = await fetch("/ffmpegserver/upload/urls",
{ method: "POST", headers: { 'Accept': 'application/json', 'Content-Type': 'application/json' },
body: JSON.stringify({ urls: urls}) });
const json = await res.json();
return json;
}
window.onload = async () => {
const result = await sendURL([
"http://s5.qhres.com/static/465f1f953f1e6ff2.mp3",
"https://file-examples-com.github.io/uploads/2017/11/file_example_MP3_700KB.mp3"
]);
console.log(result);
}
我的钱说响应不是有效的json,可能是HTML(因此
这是否回答了您的问题?“SyntaxError:Unexpected tokentry/catch