Skip to content

HTTP API Gateway is only forwarding the first parameter string.

0

I have an HTTP API Gateway set up with a route accepting /{proxy+} on ANY It is using an HTTP URI integration set to ANY method with an external endpoint. (I am using webhook.site for testing)

If I send a request to my gateway (for example: gatewayuri.com/?a=1&b=2&c=3) the endpoint only receives a=1 and none of the rest.

How do I get the rest of the parameters to pass through? I do not have definitive list of query string keys to set manually, I need it to pass whatever query string is used.

1 Answer
1

It seems like you're encountering an issue with your HTTP API Gateway not forwarding all query string parameters to your backend endpoint. This is unexpected behavior for an HTTP proxy integration, which should pass through all request data, including query string parameters.

For an HTTP API Gateway with a /{proxy+} route and ANY method using HTTP proxy integration, all query string parameters should be automatically forwarded to the backend endpoint without any additional configuration.

To troubleshoot this issue:

  1. Double-check that you are indeed using HTTP proxy integration. In the API Gateway console, verify that the integration type for your route is set to "HTTP proxy."

  2. Ensure that your backend endpoint (webhook.site in this case) is correctly configured to receive and display all query parameters. Sometimes, the issue might be with how the receiving end processes or displays the parameters.

  3. Try testing with different combinations of query parameters to see if the problem persists across various scenarios.

  4. If possible, try creating a new API with the same configuration to see if the issue is specific to your current setup.

  5. Check if there are any request or response transformations applied to your API that might be interfering with the query string parameters.

If the problem persists after these checks, it may be worth contacting AWS support, as this behavior is not typical for HTTP proxy integration in API Gateway. HTTP proxy integration should pass through all request data, including headers, query string parameters, URL path variables, and payload, without requiring any additional configuration for individual parameters.

Remember that for non-proxy integrations, you would need to explicitly map query string parameters, but this shouldn't be necessary for your HTTP proxy integration setup.

Sources
Tutorial: Create a REST API with an HTTP proxy integration - Amazon API Gateway
API Gateway doesn't pass query parameters on to Lambda function when the resource is +proxy/ | AWS re:Post

answered 10 months ago
EXPERT
reviewed 10 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.