Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1ed517c

Browse filesBrowse files
mcgittydanielleadams
authored andcommitted
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 b367d5a commit 1ed517c
Copy full SHA for 1ed517c

File tree

Expand file treeCollapse file tree

1 file changed

+6
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-0
lines changed
Open diff view settings
Collapse file

‎doc/api/https.md‎

Copy file name to clipboardExpand all lines: doc/api/https.md
+6Lines changed: 6 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ changes:
275275
* `port` **Default:** `443`
276276
* `agent` **Default:** `https.globalAgent`
277277
* `callback` {Function}
278+
* Returns: {http.ClientRequest}
278279

279280
Makes a request to a secure web server.
280281

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

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

@@ -458,6 +463,7 @@ headers: max-age=0; pin-sha256="WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18="; p
458463
[`URL`]: url.md#url_the_whatwg_url_api
459464
[`http.Agent(options)`]: http.md#http_new_agent_options
460465
[`http.Agent`]: http.md#http_class_http_agent
466+
[`http.ClientRequest`]: http.md#http_class_http_clientrequest
461467
[`http.Server#headersTimeout`]: http.md#http_server_headerstimeout
462468
[`http.Server#keepAliveTimeout`]: http.md#http_server_keepalivetimeout
463469
[`http.Server#maxHeadersCount`]: http.md#http_server_maxheaderscount

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.