You want to access the HTTP headers sent in a request.
Use the msg.req.headers
property of the message sent by the HTTP In
node to access the headers.
[~]$ curl http://localhost:1880/hello-headers
<html>
<head></head>
<body>
<h1>User agent: curl/7.49.1</h1>
</body>
</html>
The msg.req.headers
property is an object of key/value pairs for each request header.
The header names are all lower-cased regardless of how they appear in the request.
Node-RED: Low-code programming for event-driven applications.
Copyright OpenJS Foundation and Node-RED contributors. All rights reserved. The OpenJS Foundation has registered trademarks and uses trademarks. For a list of trademarks of the OpenJS Foundation, please see our Trademark Policy and Trademark List. Trademarks and logos not indicated on the list of OpenJS Foundation trademarks are trademarks™ or registered® trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them.
The OpenJS Foundation | Terms of Use | Privacy Policy | OpenJS Foundation Bylaws | Trademark Policy | Trademark List | Cookie Policy