request.js/examples/get-to-json.js

13 lines
341 B
JavaScript

'use strict';
//var request = require('urequest');
var request = require('../');
request('https://www.google.com', function (error, response, body) {
if (error) {
console.log('error:', error); // Print the error if one occurred
return;
}
console.log('response.toJSON()');
console.log(response.toJSON());
});