Browse Source

doc: changed order of invocations in https.request() example.

When you call req.end() before you add .on listeners you get an Error that you can't call .on on undefined.

PR-URL: https://github.com/nodejs/node/pull/9614
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
v6
atrioom 8 years ago
committed by Italo A. Casas
parent
commit
19cce15cbb
  1. 2
      doc/api/https.md

2
doc/api/https.md

@ -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

Loading…
Cancel
Save