fly icon indicating copy to clipboard operation
fly copied to clipboard

:rocket: Supporting request forwarding and Promise based HTTP client for all JavaScript runtimes.

Results 93 fly issues
Sort by recently updated
recently updated
newest added

* fly请求微信的code2Session对返回的结果取data项返回的是字符串,而不是对象,我们必须手动去转换下才可以转化为JSON对象,而axios的则不用,这是为什么啊? ```js let result = await fly.get("https://api.weixin.qq.com/sns/jscode2session", { appid, secret, js_code, grant_type: "authorization_code", }); console.log(result.data); console.log("fly时候返回的结果",typeof result.data); ``` ![202207211035160](https://user-images.githubusercontent.com/54466523/180117845-ea0628a7-5625-4f2a-82a6-776a9c361c08.png)

把`request`,`get`,`post`的单一`any`泛型去掉,拓展了更友好的`ts`提示,可以定义请求`data`的类型和返回类型 ```ts type wxLoginRes = 'code' | 'encryptedData' | 'iv' | 'rawData' | 'signature' type loginToken = Record interface loginRes { loginToken: loginToken } fly.post('xxx', { code, encryptedData, iv, signature,...

文件下载(download (url, savePath, params = null, options={})) 文件上传(upload(url,formData,options={})) 支持获取进度吗?

在使用 npm 安装的 fly 的 vue 项目中发生的。 与解构类似,ES Module 导出也会导致该问题。 查看报错栈,发现 `fly.js` 内部使用了上下文: https://github.com/wendux/fly/blob/fced928bfe7449d0fa18d5fea466cce1e3bda465/src/fly.js#L353 有改进以支持解构赋值和 ES Module 导出的可能吗?

``` if (!store) { fly.lock(); tokenFly.get('/user', {}, { headers: { sessionKey: token } }).then((result) => { if(result.data.code === 'C200') { store.setUserInfo({ userInfo: result.data.data }) } return request; //只有最终返回request对象时,原来的请求才会继续 }).finally(()=>{ fly.unlock();//解锁后,会继续发起请求队列中的任务,详情见后面文档...

post 部分请求,url 需要加参数对象,fly 能支持吗?比如 fly.request({ url: url, method: ”post“, params: "query参数对象", data: ”post实体对象“ })

支付宝小程序引入 var Fly=require("flyio/dist/npm/ap") put请求在模拟器上可以,在真机上接收不到put的data数据

为什么在jest里面始终超时啊

后端获取到的session每次都不一样 request header头中没有Cookie参数发送 ![image](https://user-images.githubusercontent.com/23472375/74796090-97338f00-5302-11ea-9ea7-3ebfd99413a2.png)