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 italoacasas committed Nov 24, 2016
1 parent 7eb2e3f commit 19cce15
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 19cce15

Please sign in to comment.