Skip to content

Commit 28fddc0

Browse files
mikawsaduh95
authored andcommitted
doc: add array type in http request headers
Document that the headers option in http.request() can be either an object or an array of strings, similar to message.rawHeaders. PR-URL: #58049 Fixes: #57986 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Paolo Insogna <paolo@cowtech.it> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
1 parent 8bd698b commit 28fddc0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

doc/api/http.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3818,7 +3818,8 @@ changes:
38183818
* `family` {number} IP address family to use when resolving `host` or
38193819
`hostname`. Valid values are `4` or `6`. When unspecified, both IP v4 and
38203820
v6 will be used.
3821-
* `headers` {Object} An object containing request headers.
3821+
* `headers` {Object|Array} An object or an array of strings containing request
3822+
headers. The array is in the same format as [`message.rawHeaders`][].
38223823
* `hints` {number} Optional [`dns.lookup()` hints][].
38233824
* `host` {string} A domain name or IP address of the server to issue the
38243825
request to. **Default:** `'localhost'`.
@@ -4273,6 +4274,7 @@ A browser-compatible implementation of [`WebSocket`][].
42734274
[`http.globalAgent`]: #httpglobalagent
42744275
[`http.request()`]: #httprequestoptions-callback
42754276
[`message.headers`]: #messageheaders
4277+
[`message.rawHeaders`]: #messagerawheaders
42764278
[`message.socket`]: #messagesocket
42774279
[`message.trailers`]: #messagetrailers
42784280
[`net.Server.close()`]: net.md#serverclosecallback

0 commit comments

Comments
 (0)