axios get post请求

接口1:随机笑话

请求地址:https://autumnfish.cn/api/joke/list

请求方法:get

请求参数:num(笑话条数,数字)

相应内容:随机笑话

axios.get("https://autumnfish.cn/api/joke/list?num=6")

.then(function(res){

   console.log(response);

},function(err){

   console.log(err)

})

 

接口1:用户注册

请求地址:https://autumnfish.cn/api/user/reg

请求方法:post

请求参数:username(用户名,字符串)

相应内容:注册成功或者失败


axios.post("https://autumnfish.cn/api/user/reg",{username:"小学生搬砖选手"})

.then(function(res){

  console.log(response);

},function(err){  

     console.log(err)

})

  

 

posted @ 2019-12-09 15:43  帖子搬运工  阅读(2115)  评论(0编辑  收藏  举报