is there any good Http library for React flux architecture

浪子不回头ぞ 提交于 2019-11-29 11:45:35

问题


We have a react application with Flux architecture, I am searching any good library for sending http request like angular's $http, $resources.


回答1:


You don't need something specific for React or Flux, you can use a regular CommonJS module. There are several you can use, my favourites are:

  • Superagent: small, easy to use and easily extensible via plugins
  • Axios: really nice implementation of the Promise API and Client side support for protecting against XSRF (plus supports IE8)
  • Fetch: built by Github so support is pretty good

All the links include installation and usage




回答2:


Yes you can use the whatwg-fetch you have to install it using

$ npm install whatwg-fetch --save

for more information please refer fetch




回答3:


the best http library for react and for js - isomorphic-fetch, it works in all browsers, have small size and have promises support

https://github.com/matthew-andrews/isomorphic-fetch

not use:

  • axios library have big size

  • request library does not have support promises

  • native fetch does not have support all browsers



来源:https://stackoverflow.com/questions/33821053/is-there-any-good-http-library-for-react-flux-architecture

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!