Skip to content

Commit fbb36ed

Browse files
jasnelladdaleax
authored andcommitted
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 f2f1537 commit fbb36ed

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
@@ -2108,6 +2108,8 @@ http.get('http://nodejs.org/dist/index.json', (res) => {
21082108
const contentType = res.headers['content-type'];
21092109

21102110
let error;
2111+
// Any 2xx status code signals a successful response but
2112+
// here we're only checking for 200.
21112113
if (statusCode !== 200) {
21122114
error = new Error('Request Failed.\n' +
21132115
`Status Code: ${statusCode}`);

0 commit comments

Comments
 (0)