summaryrefslogtreecommitdiff
path: root/test/simple/test-http-chunked.js
blob: f1895737b1a77ea59a5311a39bf6c4aa5624d251 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
process.mixin(require("../common"));
var http = require("http");
var PORT = 8888;

var UTF8_STRING = "Il était tué";

var server = http.createServer(function(req, res) {
  res.writeHeader(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();
})