Skip to content

根据axios源码,使用ts实现的ts版axios现在只实现了web环境的功能

License

Notifications You must be signed in to change notification settings

WXperia/ts-axios

使用TypeScript library starter重构Axios

目前已经实现的功能

  1. 在浏览器端使用 XMLHttpRequest 对象通讯
  2. 支持 Promise API
  3. 支持请求和响应的拦截器 interceptor.request/resopnse
  4. 支持请求数据和响应数据的转换 json
  5. 支持请求的取消 cancel
  6. JSON 数据的自动转换
  7. 客户端防止 XSRF
  8. 完成上传和下载事件的外部回调 onUploadProgress & onDownloadProgress
  9. baseURL
  10. axios.all
  11. axios.spread
  12. axios.getUri
  13. paramsSerializer
  14. validateStatus

使用

npm install

npm run dev

127.0.0.1:8080

flg

抽空进一步学习下node,完成axios在node的实现。

About

根据axios源码,使用ts实现的ts版axios现在只实现了web环境的功能

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors