Skip to content

Commit a720c0e

Browse files
committed
doc: add comment to example about 2xx status codes
Fixes: #29714 PR-URL: #34223 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
1 parent 14ac6e4 commit a720c0e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

doc/api/http.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2236,6 +2236,8 @@ http.get('http://nodejs.org/dist/index.json', (res) => {
22362236
const contentType = res.headers['content-type'];
22372237

22382238
let error;
2239+
// Any 2xx status code signals a successful response but
2240+
// here we're only checking for 200.
22392241
if (statusCode !== 200) {
22402242
error = new Error('Request Failed.\n' +
22412243
`Status Code: ${statusCode}`);

0 commit comments

Comments
 (0)