mikeal-request

How to use:

  • Try request
  • then
    1
    2
    3
    cd demos
    npm install
    node demo1.js

Demo1

RUN node demo1.js

The code inside demo1.js is shown below:

1
2
3
4
5
6
var request = require('request');
request('http://www.google.com', function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body) // Print the google web page.
}
})