From ef7e3ac432853871c96dd7db642a1700c95ba32b Mon Sep 17 00:00:00 2001 From: atrioom Date: Tue, 15 Nov 2016 12:47:30 +0100 Subject: [PATCH] doc: changed order of invocations in example. When you call req.end() before you add .on listeners you get an Error that you can't call .on on undefined. --- doc/api/https.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/api/https.md b/doc/api/https.md index c2231dca1830e5..1c3793a32908ec 100644 --- a/doc/api/https.md +++ b/doc/api/https.md @@ -158,11 +158,12 @@ 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