Skip to content

Commit cebb93e

Browse files
mikawstargos
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 d0faf72 commit cebb93e

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
@@ -3820,7 +3820,8 @@ changes:
38203820
* `family` {number} IP address family to use when resolving `host` or
38213821
`hostname`. Valid values are `4` or `6`. When unspecified, both IP v4 and
38223822
v6 will be used.
3823-
* `headers` {Object} An object containing request headers.
3823+
* `headers` {Object|Array} An object or an array of strings containing request
3824+
headers. The array is in the same format as [`message.rawHeaders`][].
38243825
* `hints` {number} Optional [`dns.lookup()` hints][].
38253826
* `host` {string} A domain name or IP address of the server to issue the
38263827
request to. **Default:** `'localhost'`.
@@ -4275,6 +4276,7 @@ A browser-compatible implementation of [`WebSocket`][].
42754276
[`http.globalAgent`]: #httpglobalagent
42764277
[`http.request()`]: #httprequestoptions-callback
42774278
[`message.headers`]: #messageheaders
4279+
[`message.rawHeaders`]: #messagerawheaders
42784280
[`message.socket`]: #messagesocket
42794281
[`message.trailers`]: #messagetrailers
42804282
[`net.Server.close()`]: net.md#serverclosecallback

0 commit comments

Comments
 (0)