0
点赞
收藏
分享

微信扫一扫

axios基础

一条咸鱼的干货 2022-02-15 阅读 39
html前端

一、get请求

axios.get(地址?查询字符串).then(function(reponse){

console.log(response);

},function(err){

console.log(err);

})

解析:
1、查询字符串写法:
        key = value1&key2 = value2&.........

2、function(reponse){}:

请求成功触发函数

3、function(err){}

请求失败触发函数

二、post请求

axios.post(地址,{key:value,key2:value2}).then(function(reponse){

console.log(response);

},function(err){

console.log(err);

})

举报

相关推荐

0 条评论