请求方式
get post option
数据传递方式
- form Date form表单请求方式
- Query String 地址栏拼接 axios({})
- request post传参 axios.get请求 默认传递的是request
数据格式
字符串 JSON
JSON.parse()
JSON.stringify()
axios格式
methods: {
getData() {
// 格式
axios({
url:"http://146.56.207.108:3000/Handler/UserHandler?action=login", //接口地址
methods:"post", //请求方式
params:{ //参数
userName:this.userName,
password:this.mima
},
headers:{}
}).then(r=>{ //成功的时候
console.log(r);
}).catch(r=>{
console.log(r) //失败的时候
})
},
},