Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

APIGatewayProxyRequest queryStringParameters does not support multiple parameter values #42

Closed
thoellrich opened this issue Feb 15, 2018 · 3 comments

Comments

@thoellrich
Copy link

The URL in go's standard http.Request has a Query() accessor which returns a map[string][]string (see: https://github.com/golang/go/blob/master/src/net/url/url.go#L995). This allows one to send a request with ...&type=foo&type=bar... and get both values using http.Request.Query()["type"].

The QueryStringParameters field from APIGatewayProxyRequest on the other hand is defined as a map[string]string (see: https://github.com/aws/aws-lambda-go/blob/master/events/apigw.go#L11). Supplying ...&type=foo&type=bar... to a Lambda behind GatewayProxy only returns the last value for type - bar in this case.

A workaround is to supply the parameters as a list using a separator character as in: ...&type=foo,bar...

@fsenart
Copy link

fsenart commented Feb 15, 2018

Hi @thoellrich
This limitation comes from Amazon API Gateway, and this project only reflects this fact. You should ask for a feature request on the AWS forum.

@thoellrich
Copy link
Author

Ok - will do. Thanks.

@brydavis
Copy link

Does anyone have a great example(s) for using query strings? Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants