Just it
Read Node.js JavaScript sources
From Node: Up and Running book (that is nice book):
var http = require('http');
var opts = {
host: 'www.google.com'
port: 80,
path: '/',
method: 'GET'
};
var req = http.request(opts, function(res) {
console.log(res);
res.on('data', function(data) {
console.log(data);
});
});
req.end();
Then talking about http.get()
… Well, looking at http
module sources makes explaining verbose.
exports.get = function(options, cb) {
var req = exports.request(options, cb);
req.end();
return req;
};
Check Nodeclispe built-in Help (press F1) or Online Help on how to get Node.js sources inside Eclipse.