"message.headers" incorrectly shows use of "console.log(request.getHeaders());" as an example. #44567
Closed
Description
Affected URL(s)
https://nodejs.org/docs/latest-v16.x/api/http.html#messageheaders
https://nodejs.org/docs/latest-v18.x/api/http.html#messageheaders
Description of the problem
With req.getHeaders()
, you get an error:
$ node <name>.js
<go to: http://localhost:<port>/>
[...]
TypeError: req.getHeaders is not a function
with req.headers
, you don't.
However, the example in the docs (both v16 and v18) shows the (non-working) use of:
console.log(request.getHeaders());
..under the sub-section message.headers.