From 87f008393e3d2ceecf0ecd614a0153faeed63c9b 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 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 Reviewed-By: Luigi Pinca --- doc/api/https.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/https.md b/doc/api/https.md index c2231dca18..355fd7b133 100644 --- a/doc/api/https.md +++ b/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