我取這樣一個URL抓取後:與多形式的數據
fetch(url, {
mode: 'no-cors',
method: method || null,
headers: {
'Accept': 'application/json, application/xml, text/plain, text/html, *.*',
'Content-Type': 'multipart/form-data'
},
body: JSON.stringify(data) || null,
}).then(function(response) {
console.log(response.status)
console.log("response");
console.log(response)
})
我的API預計該數據是multipart/form-data
所以我使用這種類型的content-type
...但它給我一個迴應狀態代碼400.
我的代碼有什麼問題?