get的四种请求方法
axios.get(url)
axios.get(url?name=user&age=18)
axios.get(url,{params:{name:"",age:28}})
axios({
url,
params:{},
method:"GET"
})
post的三种请求方法
axios.post(
url,
data,//name=user&age=18
{headers:{"content-type":"application/x-www-form-urlencoded"}}
)
axios.post(
url,
data,//{"name":"user","age":18}
{headers:{"Content-Type":"application/json; charset=UTF-8"}}
)
axios.post(
url,
method:"POST",
data,//{"name":"user","age":18}
{headers:{"content-type":"application/x-www-form-urlencoded"}}
)