diff --git a/README.md b/README.md index e47dd6c49..c1a201e86 100644 --- a/README.md +++ b/README.md @@ -18,10 +18,10 @@ Request is designed to be the simplest way possible to make http calls. It suppo ```js var request = require('request'); request('http://www.google.com', function (error, response, body) { - if (!error && response.statusCode == 200) { - console.log(body) // Show the HTML for the Google homepage. - } -}) + 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. +}); ```