0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-29 23:16:30 +01:00
nodejs/test/simple/test-http-chunked.js
2010-02-26 12:20:10 -08:00

18 lines
446 B
JavaScript

process.mixin(require("../common"));
var http = require("http");
var UTF8_STRING = "Il était tué";
var server = http.createServer(function(req, res) {
res.writeHead(200, {"Content-Type": "text/plain; charset=utf8"});
res.write(UTF8_STRING, 'utf8');
res.close();
});
server.listen(PORT);
http.cat("http://localhost:"+PORT+"/", "utf8", function (err, data) {
if (err) throw err;
assert.equal(UTF8_STRING, data);
server.close();
})