在上篇文章的基础上将格式改为:
btns[2].onclick = function () {
axios({
//请求方法
method: 'POST',
url: '/axios-server',
params: {
vip: 10,
level: 30
},
Headers: {
a: 100,
b: 200
},
data: {
username: 'admin',
password: 'admin',
}
}).then(response => {
//响应状态码
console.log(response.status);
//响应状态字符串
console.log(response.statusText);
//响应头信息
console.log(response.headers);
//响应体
console.log(response.data);
})
}
标签:axios,console,log,发送,响应,ajax,data,response
From: https://blog.csdn.net/m0_74461206/article/details/142993724