request.js/examples/https-string.js

10 lines
423 B
JavaScript
Raw Permalink Normal View History

2018-06-19 01:39:19 +00:00
'use strict';
2018-06-19 07:55:40 +00:00
//var request = require('request-lite');
2018-06-19 01:39:19 +00:00
var request = require('../');
request('https://www.google.com', function (error, response, body) {
console.log('error:', error); // Print the error if one occurred
console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received
console.log('body:', body); // Print the HTML for the Google homepage.
});