How to Access header in AWS Lambda in 2018
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.
Introduction
In the usual 2018 AWS Lambda HTTP setup, API Gateway invokes the function and passes request details inside the event object. Headers are available there, but the exact field names depend on whether you are using Lambda proxy integration and whether you need single-value or multi-value header access.
Read Headers From event.headers
For most API Gateway proxy integrations, incoming HTTP headers are exposed through event.headers. In Node.js, that looks like this:
The case handling matters because header names are case-insensitive in HTTP, but the keys in the event payload may not use the exact casing you expect.
Understand The Event Shape
A typical API Gateway proxy event includes these top-level fields:
- '
httpMethod' - '
path' - '
queryStringParameters' - '
headers' - '
body' - '
requestContext'
If headers is null or missing, either the client did not send that header or the request was not routed through the integration you think it was.
A quick debug pattern is to log the event once during development.
That lets you confirm exactly where API Gateway placed the header values for your specific endpoint configuration.
Multi-Value Headers In 2018
Around that period, API Gateway also supported multi-value headers. If a client sends the same header more than once, you may need event.multiValueHeaders instead of event.headers.
Related reading
- How to access HTTP headers for request to AWS API Gateway using Lambda?
- How to access Kibana from Amazon elasticsearch service?
- How to access mysql outside my kubernetes cluster?
- How to access/ping a server located on AWS?
- How to Add a Column in DynamoDB
- how to add an empty or data map in dynamodb?
- how to add cache control in AWS S3?
- How to add item to dynamodb if a field does not exist or matches a condition?

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.