Tôi lấy một URL như sau:lấy bài với dữ liệu mẫu nhiều phần dữ liệu
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 tôi hy vọng các dữ liệu được của multipart/form-data
vì vậy tôi đang sử dụng content-type
thuộc loại này ... Nhưng nó đem lại cho tôi một phản hồi với mã trạng thái 400.
Mã của tôi có vấn đề gì?