Skip to content

Commit 12dc0e6

Browse files
mcgittytargos
authored andcommittedMay 1, 2021
doc: document return value of https.request
Add missing topic about what https.request() returns. PR-URL: #36370 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Pooja D P <Pooja.D.P@ibm.com>
1 parent 3a11ee8 commit 12dc0e6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
 

‎doc/api/https.md

+6
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ changes:
273273
* `port` **Default:** `443`
274274
* `agent` **Default:** `https.globalAgent`
275275
* `callback` {Function}
276+
* Returns: {http.ClientRequest}
276277

277278
Makes a request to a secure web server.
278279

@@ -286,6 +287,10 @@ The following additional `options` from [`tls.connect()`][] are also accepted:
286287
string, it is automatically parsed with [`new URL()`][]. If it is a [`URL`][]
287288
object, it will be automatically converted to an ordinary `options` object.
288289

290+
`https.request()` returns an instance of the [`http.ClientRequest`][]
291+
class. The `ClientRequest` instance is a writable stream. If one needs to
292+
upload a file with a POST request, then write to the `ClientRequest` object.
293+
289294
```js
290295
const https = require('https');
291296

@@ -456,6 +461,7 @@ headers: max-age=0; pin-sha256="WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18="; p
456461
[`URL`]: url.md#url_the_whatwg_url_api
457462
[`http.Agent(options)`]: http.md#http_new_agent_options
458463
[`http.Agent`]: http.md#http_class_http_agent
464+
[`http.ClientRequest`]: http.md#http_class_http_clientrequest
459465
[`http.Server#headersTimeout`]: http.md#http_server_headerstimeout
460466
[`http.Server#keepAliveTimeout`]: http.md#http_server_keepalivetimeout
461467
[`http.Server#maxHeadersCount`]: http.md#http_server_maxheaderscount

0 commit comments

Comments
 (0)
Please sign in to comment.