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 <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
  • Loading branch information
atrioom authored and MylesBorins committed Dec 20, 2016
1 parent eb5972f commit 107735a
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 107735a

Please sign in to comment.