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:
parent
7eb2e3ff66
commit
19cce15cbb
@ -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…
x
Reference in New Issue
Block a user