I'm using the following code but I'm getting the error "Unexpected token < in JSON at position 0" Why and I getting it and how can I fix this?
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);
}