Skip to content

"message.headers" incorrectly shows use of "console.log(request.getHeaders());" as an example. #44567

Closed

Description

@Det87

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.

Activity

  1. added
    doc
    on Sep 8, 2022
  2. added
    http
    on Sep 8, 2022
  3. added a commit that references this issue on Sep 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    dochttp

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions