Created
March 10, 2011 18:43
-
-
Save ncb000gt/864630 to your computer and use it in GitHub Desktop.
Node 0.4.x get example (from docs)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var http = require('http'); | |
| var options = { | |
| host: 'www.google.com', | |
| port: 80, | |
| path: '/index.html' | |
| }; | |
| http.get(options, function(res) { | |
| console.log("Got response: " + res.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