AI_botter/node_modules/fetch/example/fetchurl.js
2024-04-30 17:46:10 -08: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'));
});