Skip to content

Commit

Permalink
doc: document return value of https.request
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
mcgitty authored and targos committed May 1, 2021
1 parent 3a11ee8 commit 12dc0e6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions doc/api/https.md
Expand Up @@ -273,6 +273,7 @@ changes:
* `port` **Default:** `443`
* `agent` **Default:** `https.globalAgent`
* `callback` {Function}
* Returns: {http.ClientRequest}

Makes a request to a secure web server.

Expand All @@ -286,6 +287,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');

Expand Down Expand Up @@ -456,6 +461,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
Expand Down

0 comments on commit 12dc0e6

Please sign in to comment.