my-fetch-plus
v0.0.5 ajax request fetch fetch-plus
MyFetchPlus
一个fetch的现代化封装
基本功能
- 以es6 class封装fetch
- 自动格式化URL QueryString
- 根据responseType自动格式化Data
- 超时取消请求
- 返回值遵循error first 原则
基本使用
安装
npm i my-fetch-plus --save
or
yarn add my-fetch-plus
引入
可以通过import或require引入
import FetchPlus from 'my-fetch-plus'
const http = new FetchPlus()
http.get('xxxx')
TODO
- 基本请求封装
- 只发送简单请求
- 单元测试
- 失败重试