Unit_AI/node_modules/fetch/example/fetchurl.js
2024-06-01 16:24:36 -04:00

17 lines
388 B
JavaScript

'use strict';
// fetch url and update charset to utf-8
var fetchUrl = require('../lib/fetch').fetchUrl;
fetchUrl('http://kreata.ee/iso-8859-15.php', function(error, meta, body){
if(error){
return console.log('ERROR', error.message || error);
}
console.log('META INFO');
console.log(meta);
console.log('BODY');
console.log(body.toString('utf-8'));
});