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

13 lines
340 B
JavaScript
Raw Permalink Normal View History

2018-06-19 06:17:04 +00:00
'use strict';
//var request = require('urequest');
var request = require('../');
2019-10-29 20:31:30 +00:00
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());
2018-06-19 06:17:04 +00:00
});