From 8d78bd0333b09fc75bb642aa1d8b3954c8f8ca55 Mon Sep 17 00:00:00 2001 From: "Fred K. Schott" Date: Tue, 21 Feb 2017 15:44:21 -0800 Subject: [PATCH] Update README.md example snippet --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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. +}); ```