Skip to content

Commit ad2fb4d

Browse files
committed
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]>
1 parent 4cd8e19 commit ad2fb4d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

doc/api/http.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -3818,7 +3818,7 @@ 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 headers. The array is in the same format as [`message.rawHeaders`][].
38223822
* `hints` {number} Optional [`dns.lookup()` hints][].
38233823
* `host` {string} A domain name or IP address of the server to issue the
38243824
request to. **Default:** `'localhost'`.
@@ -4273,6 +4273,7 @@ A browser-compatible implementation of [`WebSocket`][].
42734273
[`http.globalAgent`]: #httpglobalagent
42744274
[`http.request()`]: #httprequestoptions-callback
42754275
[`message.headers`]: #messageheaders
4276+
[`message.rawHeaders`]: #messagerawheaders
42764277
[`message.socket`]: #messagesocket
42774278
[`message.trailers`]: #messagetrailers
42784279
[`net.Server.close()`]: net.md#serverclosecallback

0 commit comments

Comments
 (0)