admin管理员组文章数量:1295722
I need a request module that works both in the Node.js server and in the client, when bundled with Webpack.
My requirements are really basic. I just need to do some HTTP Ajax requests, like get
and post
. Automatic JSON parsing would be awesome.
I'm taking a look at Request, which seems solid by the number of mits and downloads, but the website doesn't mention whether it works while bundled in the browser.
Any suggestion?
I need a request module that works both in the Node.js server and in the client, when bundled with Webpack.
My requirements are really basic. I just need to do some HTTP Ajax requests, like get
and post
. Automatic JSON parsing would be awesome.
I'm taking a look at Request, which seems solid by the number of mits and downloads, but the website doesn't mention whether it works while bundled in the browser.
Any suggestion?
Share asked Jul 30, 2015 at 1:04 Andre PenaAndre Pena 59.4k53 gold badges209 silver badges257 bronze badges 2- 1 Try request, and get back to us. Should be fine. – azium Commented Jul 30, 2015 at 1:08
- I tried request, didn't work for me. Needed lots of other dependencies. Maybe I'm doing something wrong though. Did you get it working? – willem Commented Jan 4, 2016 at 13:40
2 Answers
Reset to default 7I use axios
Promise based HTTP client for the browser and node.js
Features
- Make XMLHttpRequests from the browser
- Make http requests from node.js
- Supports the Promise API
- Intercept request and response
- Transform request and response data
- Cancel requests
- Automatic transforms for JSON data
- Client side support for protecting against XSRF
Try SuperAgent
SuperAgent is a small progressive client-side HTTP request library, and Node.js module with the same API
Works with browserify and should work with webpack
本文标签:
版权声明:本文标题:javascript - Any Node.js HTTP request module that works both in the server and in the browser when bundled with Webpack? - Stack 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741622162a2388874.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论