![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
我有多变请求库
文章平均质量分 92
神奇大叔
这个作者很懒,什么都没留下…
展开
-
flyio
支持多平台、所有js环境的网络请求方式 node使用实例: let Fly=require("flyio/src/node") let fly=new Fly; get请求: fly.get(url) .then(function (response) { console.log(response); }) .catch(function (error) { console.log(error); }); post请求: fly.p原创 2020-05-20 15:43:16 · 1242 阅读 · 0 评论 -
axios网络请求
axios网络请求 1、安装 cnpm install axios -S 2、在main.js中引入 import Axios from 'axios' 3、在main.js中将Axios挂载到Vue的原型上 Vue.prototype.$axios=Axios 4、在组件函数中使用 get请求: this.$axios.get("url") .t...原创 2020-02-15 21:38:38 · 2272 阅读 · 0 评论 -
fetch 处理网络请求
fetch get请求 fetch('路径') //返回响应对象,并要求为json格式 .then(data=>{return data.json()}) //返回真实数据 .then(res=>{xxx}) post请求 fetch('路径',{ method:'POST', //设置请求头 headers:{ '...原创 2020-02-12 21:08:50 · 1005 阅读 · 0 评论 -
服务器端请求request库
1、安装 cnpm install request --save 2、引入 var request =require('request') 3、使用 GET请求: request.get({ uri:'地址', json:true, qs:{ 参数键值对 } },(err,response,data)=>{ if(response.statusCode===200)原创 2020-07-13 21:44:10 · 214 阅读 · 0 评论