request.js/examples/http-string.js

10 lines
422 B
JavaScript

'use strict';
//var request = require('request-lite');
var request = require('../');
request('http://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.
});