diff --git a/doc/api/http.md b/doc/api/http.md index 4ceebe16c3fe6b..f90918590541a7 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -2236,6 +2236,8 @@ http.get('http://nodejs.org/dist/index.json', (res) => { const contentType = res.headers['content-type']; let error; + // Any 2xx status code signals a successful response but + // here we're only checking for 200. if (statusCode !== 200) { error = new Error('Request Failed.\n' + `Status Code: ${statusCode}`);