- Newest
- Most votes
- Most comments
You can definitely pass both headers and query parameters in a GET request in API Gateway. The issue you're experiencing is likely related to how you're configuring the parameter mappings.
To pass both headers and query parameters in a GET request:
-
In your API Gateway configuration, make sure both the header and query parameters are properly defined in the Method Request section.
-
Then in the Integration Request section, map both the header and query parameters correctly:
For headers:
"integration.request.header.custom-header": "method.request.header.custom-header"
For query parameters:
"integration.request.querystring.query_param": "method.request.querystring.query_param"
Your configuration looks correct based on what you've shared. A few things to check:
- Make sure you're actually sending the custom header in your test requests
- Verify that your API has been redeployed after making these changes
- Check if there are any caching issues affecting your tests
API Gateway fully supports passing both headers and query parameters in GET requests - you don't need to switch to POST. The documentation you referenced is likely showing a specific use case for transforming a POST request to a GET request at the integration level, not suggesting that you can't use headers with GET requests.
If you're using the AWS console, you can also try:
- Go to the Method Request configuration
- Add both your header and query parameter there
- Then in Integration Request, map both parameters as shown above
- Save and deploy your API
API Gateway supports multi-value headers and parameters, so there shouldn't be any technical limitation preventing you from using both in a GET request.
Sources
Passing X-Forwarded-Host and X-Forwarded-Port headers from API Gateway | AWS re:Post
Transform API requests and responses for HTTP APIs in API Gateway - Amazon API Gateway
Lambda proxy integrations in API Gateway - Amazon API Gateway
Tutorial: Create a REST API with an HTTP non-proxy integration - Amazon API Gateway
Relevant content
asked 4 years ago
asked 3 years ago

Well I've definitely made sure that my mappings looks completely correct. In Method Request Section, under URL query string parameters I see
query_paramunder name and underHTTP request headersI seecustom-headerunder Nameand
In Integration Request section, the mappings also looks correct with query params as query_param method.request.querystring.query_param and header as custom-header method.request.header.custom-header
and as I mentioned, I used the same header config for another GET request which didn't have query parameters, I was able to see the headers being passed in that one. Not sure why this specific GET request with both query params and headers is not working