💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
#### 1. 发起get请求 当发起get请求之后,通过 .then 来设置成功的回调函数 ``` this.$http.get('url').then(function(res){ console.log(res.body); //通过res.body 拿到服务器返回的数据 }) ``` #### 2. 发起post请求 发起post请求, application/x-wwww-form-urlencoded 手动发起的Post请求,默认没有表单格式,所以有的服务器处理不了 通过post方法的第三个参数,{ emulateJSON: true } 设置提交的内容类型为普通表单数据格式 ``` this.$http.post('url', {}, {emulateJSON: true}) .then(res=>{ console.log(res.body); }) ``` #### 3. 发起JSONP请求 ``` this.$http.jsonp('url').then(res=>{ console.log(res.body); }) ```