Inside the code, I want to download "http://www.google.com" and store it in a string. I know how to do that in urllib in python. But how do you do it in Node.JS + Express?
相关问题
- Angular RxJS mergeMap types
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- void before promise syntax
- npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fs
doc link : https://github.com/request/request
Using node.js you can just use the http.request method
http://nodejs.org/docs/v0.4.7/api/all.html#http.request
This method is built into node you just need to require http.
If you just want to do a GET, then you can use http.get
http://nodejs.org/docs/v0.4.7/api/all.html#http.get
(Example from node.js docs)
You could also use mikeal's request module
https://github.com/mikeal/request