Skip to content

Commit 87f0083

Browse files
atrioomMylesBorins
atrioom
authored andcommitted
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: #9614 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 7051ea8 commit 87f0083

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

doc/api/https.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,11 @@ var req = https.request(options, (res) => {
158158
process.stdout.write(d);
159159
});
160160
});
161-
req.end();
162161

163162
req.on('error', (e) => {
164163
console.error(e);
165164
});
165+
req.end();
166166
```
167167

168168
The options argument has the following options

0 commit comments

Comments
 (0)