diff --git a/doc/api/http.md b/doc/api/http.md index 550beedb055ce6..d94f791e462833 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -2233,6 +2233,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}`);