Skip to content

Commit

Permalink
doc: https - changed order of invocations in 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 italoacasas committed Nov 24, 2016
1 parent 7eb2e3f commit 550a958
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 550a958

Please sign in to comment.