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 danielleadams committed Jan 12, 2021
1 parent b367d5a commit 1ed517c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions doc/api/https.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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');

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1ed517c

Please sign in to comment.