summaryrefslogtreecommitdiff
path: root/test/parallel/test-http-client-encoding.js
blob: a93b33620fe934e56b336cf3ff28e614985bc621 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
var common = require('../common');
var assert = require('assert');

var http = require('http');

http.createServer(function(req, res) {
  res.end('ok\n');
  this.close();
}).listen(common.PORT, test);

function test() {
  http.request({
    port: common.PORT,
    encoding: 'utf8'
  }, function(res) {
    res.pipe(process.stdout);
  }).end();
}