You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
http.request should be documented to receive an headers array #57986
It appears that the implementation of http.request allows sending headers as an array of strings, similar to response.writeHead. However, this feature is not documented. I am wondering if this is an oversight or intentionally left undocumented. If it is not intentional, I would be happy to update the documentation to reflect this functionality. I just wanted to confirm before proceeding.
it seems that Array here is not something coincidentally working but rather explicitly handled as one of the possible value on options.headers so I thing it should be also mentioned in documentation, but of course I may be wrong 😅
Edit: on the other side I found some old issue #2400 - this is about Array in Array ([['Content-Type', 'text/plain'], ['X-Data', 'hello world']] in options.headers but maybe it also has relevance in context of this issue.
Activity
TanzimHossainSafin commentedon May 1, 2025
Hey how can i contribute, please assign me
pmarchini commentedon May 1, 2025
Hey @tanzimsafin, we don’t assign issues, but you’re more than welcome to contribute by opening a PR! 😁
arturgawlik commentedon May 3, 2025
From my shallow analysis of
node/lib/_http_client.js
Line 294 in 4a4aa58
Arrayhere is not something coincidentally working but rather explicitly handled as one of the possible value onoptions.headersso I thing it should be also mentioned in documentation, but of course I may be wrong 😅Edit: on the other side I found some old issue #2400 - this is about Array in Array (
[['Content-Type', 'text/plain'], ['X-Data', 'hello world']]inoptions.headersbut maybe it also has relevance in context of this issue.souravmanikandan commentedon May 31, 2025
would anyone please help me how to solve it. i am new to opesource.
Dinesh0007000 commentedon Jun 20, 2025
Hi, I'm interested in contributing to this issue. I'll prepare a PR for the documentation update.
doc: clarify http.request supports headers as array
doc: clarify http.request supports headers as array
doc: clarify http.request supports headers as array
doc: add array type in http request headers
doc: add array type in http request headers
doc: add array type in http request headers
doc: add array type in http request headers