Skip to content

Instantly share code, notes, and snippets.

@ntanya
Created June 8, 2012 22:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ntanya/2898315 to your computer and use it in GitHub Desktop.
Save ntanya/2898315 to your computer and use it in GitHub Desktop.
GET with node
app.get('/', function(req, res){
var user = "twitterapi;
var completeResponse = "";
var options = {
host: 'api.twitter.com',
port: 80,
path: '/1/users/show.json?screen_name=' + user
};
var request = http.get(options, function(result) {
console.log("Got response: " + result.statusCode);
}).on('error', function(e) {
console.log("Got error: " + e.message);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment