如何使用抓取对多部分表单数据进行开机自检?
2022-08-30 04:15:02
我正在获取如下网址:
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期望数据是的,所以我正在使用这种类型的...但它给了我一个状态代码为400的响应。multipart/form-data
content-type
我的代码出了什么问题?