Created
February 24, 2010 04:54
-
-
Save Marak/313115 to your computer and use it in GitHub Desktop.
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
hookIO.createHttpClient = function(options){ | |
sys.puts('i should be an event that does an http request for ' + JSON.stringify(options)); | |
var google = http.createClient(80, options.host); | |
var request = google.request("GET", options.path, {"host": options.host}); | |
request.addListener('response', function (response) { | |
//sys.puts("HTTP REQUEST STATUS CODE: " + response.statusCode); | |
//sys.puts("HEADERS: " + JSON.stringify(response.headers)); | |
response.setBodyEncoding("utf8"); | |
response.addListener("data", function (chunk) { | |
// ignore response for now | |
//sys.puts("BODY: " + chunk); | |
}); | |
}); | |
request.close(); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment