Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>
  • Loading branch information
mikaws committed Apr 30, 2025
commit 238caa51d4bec9ee0e5de1af50e63f9eb9c0a750
4 changes: 3 additions & 1 deletion doc/api/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -3818,7 +3818,8 @@ changes:
* `family` {number} IP address family to use when resolving `host` or
`hostname`. Valid values are `4` or `6`. When unspecified, both IP v4 and
v6 will be used.
* `headers` {Object} An object containing request headers.
* `headers` {Object|Array} An object or an array of strings containing request
headers. The array is in the same format as [`message.rawHeaders`][].
* `hints` {number} Optional [`dns.lookup()` hints][].
* `host` {string} A domain name or IP address of the server to issue the
request to. **Default:** `'localhost'`.
Expand Down Expand Up @@ -4273,6 +4274,7 @@ A browser-compatible implementation of [`WebSocket`][].
[`http.globalAgent`]: #httpglobalagent
[`http.request()`]: #httprequestoptions-callback
[`message.headers`]: #messageheaders
[`message.rawHeaders`]: #messagerawheaders
[`message.socket`]: #messagesocket
[`message.trailers`]: #messagetrailers
[`net.Server.close()`]: net.md#serverclosecallback
Expand Down
Loading