fetch
2023-08-27 本文已影响0人
xueyueshuai
fetch('http://localhost:3000/books', {
method: 'post',
body: JSON.stringify({
uname: '张三',
pwd: '456'
}),
headers: {
'Content-Type': 'application/json'
}
})
.then((data) =>{
return data.json();
}).then( (res)=> {
console.log(res)
});