See the documentation :
With http.request (), you always need to call req.end () to indicate that you are finished with the request - even if there is no data that is written to the request authority.
You create a request, but you do not complete it. In your calls you must:
var req = http.request(options, function(page) {
This assumes that you are making a normal GET request without a body.
You should also consider http.get , which is a good shortcut:
http.get("http://127.0.0.1:3002/first", function(res) {
Update Another thing is that callbacks in async should look like
function(err, res) { ... }
The way you do this will no longer work, because the http.get callback accepts only one res argument. What you need to do is the following:
http.get('http://127.0.0.1:3002/second', function(res) { callback(null, res); });
source share