Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Chen <4326639+mcgitty@users.noreply.github.com>2020-12-03 22:40:58 +0300
committerAntoine du Hamel <duhamelantoine1995@gmail.com>2020-12-26 16:04:05 +0300
commit9df3b762d770789a6260e4dfbc11451ef62a9cec (patch)
tree22deffb2ef1e5817805e0b26b5128c134951a0fe /doc/api/https.md
parent8c94aea98eec640c58cd6b2e1c88befdfdb82dc8 (diff)
doc: document return value of https.request
Add missing topic about what https.request() returns. PR-URL: https://github.com/nodejs/node/pull/36370 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Pooja D P <Pooja.D.P@ibm.com>
Diffstat (limited to 'doc/api/https.md')
-rw-r--r--doc/api/https.md6
1 files changed, 6 insertions, 0 deletions
diff --git a/doc/api/https.md b/doc/api/https.md
index b322c3ee147..f4c1f0487a7 100644
--- a/doc/api/https.md
+++ b/doc/api/https.md
@@ -275,6 +275,7 @@ changes:
* `port` **Default:** `443`
* `agent` **Default:** `https.globalAgent`
* `callback` {Function}
+* Returns: {http.ClientRequest}
Makes a request to a secure web server.
@@ -288,6 +289,10 @@ The following additional `options` from [`tls.connect()`][] are also accepted:
string, it is automatically parsed with [`new URL()`][]. If it is a [`URL`][]
object, it will be automatically converted to an ordinary `options` object.
+`https.request()` returns an instance of the [`http.ClientRequest`][]
+class. The `ClientRequest` instance is a writable stream. If one needs to
+upload a file with a POST request, then write to the `ClientRequest` object.
+
```js
const https = require('https');
@@ -458,6 +463,7 @@ headers: max-age=0; pin-sha256="WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18="; p
[`URL`]: url.md#url_the_whatwg_url_api
[`http.Agent(options)`]: http.md#http_new_agent_options
[`http.Agent`]: http.md#http_class_http_agent
+[`http.ClientRequest`]: http.md#http_class_http_clientrequest
[`http.Server#headersTimeout`]: http.md#http_server_headerstimeout
[`http.Server#keepAliveTimeout`]: http.md#http_server_keepalivetimeout
[`http.Server#maxHeadersCount`]: http.md#http_server_maxheaderscount