Unit_AI/node_modules/fetch/example/fetchurl.js

18 lines
388 B
JavaScript
Raw Normal View History

2024-06-01 21:24:36 +01:00
'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'));
});