mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
399 B
17 lines
399 B
16 years ago
|
var c = new node.http.Client(8000, "localhost")
|
||
|
|
||
|
var req = c.get("/hello/world", [["Accept", "*/*"]]);
|
||
|
req.finish(function (res) {
|
||
|
puts("got response: " + res.status_code.toString());
|
||
|
|
||
|
res.onBody = function (chunk) {
|
||
|
puts("got response body <" + chunk.encodeUtf8() + ">");
|
||
|
return true;
|
||
|
};
|
||
|
|
||
|
res.onBodyComplete = function () {
|
||
|
puts("response complete!");
|
||
|
return true;
|
||
|
};
|
||
|
});
|