fetch('请求网址',
{
method: 'GET|POST',
headers: {
'Content-Type': 'application/json'
// 'Content-Type': 'application/x-www-form-urlencoded',
},
body: JSON.stringify(data),
credentials: 'include'
})
.then(response => response.blob())
.then(data => {
let reader = new FileReader();
reader.onload = () => {
let text = reader.result;
console.log(text);
}
reader.readAsText(data, 'GBK');
})
.catch(error => {
console.log(error);
});
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)