apiswaggerswagger-node-expressapigee127swagger-tools

How to access header keys from inside swagger-tools controllers?


When a parameter is defined to be 'in' header, then swagger-tools makes it available to controllers via 'args' variable, but other header's keys will not be included.

My question is: how to read header keys and values that are not specifically defined in 'parameters' section, such as 'cache-control' or 'X-Requested-With'?


Solution

  • Request headers are included in:

    res.socket.parser.incoming.headers