本文介绍了有什么好的React架构的Http库吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我们有一个具有Flux架构的react应用程序,我正在搜索任何不错的库来发送http请求,例如angular的$ http,$ resources.
We have a react application with Flux architecture, I am searching any good library for sending http request like angular's $http, $resources.
推荐答案
您不需要特定于React或Flux的东西,可以使用常规的CommonJS模块.您可以使用几种,我的最爱是:
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 :体积小,易于使用且可通过插件轻松扩展
- Axios :Promise API和客户端支持的非常好的实现,可以防止 XSRF (并支持IE8)
- 获取:由Github构建,因此支持非常好
- 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
这篇关于有什么好的React架构的Http库吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!