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>
This commit is contained in:
atrioom authored and Myles Borins committed 2016-12-20 14:31:18 -05:00
1 parent 7051ea8606
commit 87f008393e
1 file changed
+1 -1
+1 -1
View File
@@ -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