Welcome to mirror list, hosted at ThFree Co, Russian Federation.

test-http-client-encoding.js « parallel « test - github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d2aa8fdcbbac463c91c8a1a49466084f155c0f1b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
'use strict';
require('../common');

const http = require('http');

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

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