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
path: root/doc
diff options
context:
space:
mode:
authorK.C.Ashish Kumar <703559+kcak11@users.noreply.github.com>2022-04-07 19:48:43 +0300
committerGitHub <noreply@github.com>2022-04-07 19:48:43 +0300
commit28d8614add51b7cc48cea7cf4c4094231b005237 (patch)
treebe681da0ff6094d8b5a649ccd7dddd871d607399 /doc
parent44fdf953ba435a46a3525bc877069044a3157e7d (diff)
http: document that ClientRequest inherits from OutgoingMessage
http: fix extends for ClientRequest from Stream to http.OutgoingMessage http: added page entry for http.OutgoingMessage http: updated order of links http: included entry for http.OutgoingMessage http: removed unnecessary entry from md file PR-URL: https://github.com/nodejs/node/pull/42642 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Paolo Insogna <paolo@cowtech.it> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/api/http.md10
1 files changed, 5 insertions, 5 deletions
diff --git a/doc/api/http.md b/doc/api/http.md
index dd8c90d79a3..86234e2fef8 100644
--- a/doc/api/http.md
+++ b/doc/api/http.md
@@ -393,7 +393,7 @@ agent. Do not modify.
added: v0.1.17
-->
-* Extends: {Stream}
+* Extends: {http.OutgoingMessage}
This object is created internally and returned from [`http.request()`][]. It
represents an _in-progress_ request whose header has already been queued. The
@@ -2221,7 +2221,7 @@ Key-value pairs of header names and values. Header names are lower-cased.
// { 'user-agent': 'curl/7.22.0',
// host: '127.0.0.1:8000',
// accept: '*/*' }
-console.log(request.headers);
+console.log(request.getHeaders());
```
Duplicates in raw headers are handled in the following ways, depending on the
@@ -2388,15 +2388,15 @@ Accept: text/plain
To parse the URL into its parts:
```js
-new URL(request.url, `http://${request.headers.host}`);
+new URL(request.url, `http://${request.getHeaders().host}`);
```
When `request.url` is `'/status?name=ryan'` and
-`request.headers.host` is `'localhost:3000'`:
+`request.getHeaders().host` is `'localhost:3000'`:
```console
$ node
-> new URL(request.url, `http://${request.headers.host}`)
+> new URL(request.url, `http://${request.getHeaders().host}`)
URL {
href: 'http://localhost:3000/status?name=ryan',
origin: 'http://localhost:3000',