From 107735a6e196b782fb65448abe41876ee2d3edef 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 17c83f39a371a6..a5ff6afbd6f4aa 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