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

13 lines
329 B
JavaScript
Raw Permalink Normal View History

2018-06-19 06:17:04 +00:00
'use strict';
2018-06-19 07:55:40 +00:00
//var request = require('request-lite');
2018-06-19 06:17:04 +00:00
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());
});