Skip to content

Commit db8ca62

Browse files
authored
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 <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Paolo Insogna <[email protected]> Reviewed-By: Marco Ippolito <[email protected]> Reviewed-By: Ethan Arrowood <[email protected]>
1 parent 94f7568 commit db8ca62

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)