mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
12 lines
343 B
TypeScript
12 lines
343 B
TypeScript
import charset = require('charset');
|
|
import http = require('http');
|
|
|
|
http.get('http://nodejs.org', (res) => {
|
|
res.on('data', (chunk: Buffer) => {
|
|
console.log(charset(res.headers, chunk));
|
|
console.log(charset(res, chunk));
|
|
console.log(charset('content-type header, for example charset=utf8', chunk));
|
|
res.destroy();
|
|
});
|
|
});
|