Skip to content

Commit

Permalink
doc: changed order of invocations in https.request() example.
Browse files Browse the repository at this point in the history
When you call req.end() before you add .on listeners you get an Error that you can't call .on on undefined.

PR-URL: #9614
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
atrioom authored and addaleax committed Dec 5, 2016
1 parent c7cd400 commit a8d84d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion doc/api/https.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,11 @@ var req = https.request(options, (res) => {
process.stdout.write(d);
});
});
req.end();

req.on('error', (e) => {
console.error(e);
});
req.end();
```

The options argument has the following options
Expand Down

0 comments on commit a8d84d5

Please sign in to comment.