From 69790bd7edc9babd4c927e8be7507956157bc80f Mon Sep 17 00:00:00 2001 From: "ali.ibrahim" Date: Thu, 20 Oct 2016 11:58:06 +0200 Subject: [PATCH] Documenting ClientRequest constructor options. --- docs/api/net.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/api/net.md b/docs/api/net.md index 9459b0cb3dcf..ff23f88204cf 100644 --- a/docs/api/net.md +++ b/docs/api/net.md @@ -83,6 +83,18 @@ If it is an object, it is expected to fully specify an HTTP request via the foll `options` properties `protocol`, `host`, `hostname`, `port` and `path` strictly follow the Node.js model as described in the [URL](https://nodejs.org/api/url.html) module. +For instance, we could have created the same request to 'github.com' as follows: + +```JavaScript +const request = net.request({ + method: 'GET', + protocol: 'https:', + hostname: 'github.com', + port: 443, + path: '/' +}) +``` + ### Instance Events #### Event: 'response'