I have a C# method which I have successfully published as an AWS Lambda function. It looks like this:
public class MyClass
{
public async Task<APIGatewayProxyResponse> Test(APIGatewayProxyRequest request, ILambdaContext context)
{
return new APIGatewayProxyResponse
{
Body = "Body: " + request.Body
+ Environment.NewLine
+ "Querystring: " + (request.QueryStringParameters == null ? "null" : string.Join(",", request.QueryStringParameters.Keys)),
StatusCode = 200
};
}
}
I have done the following to configure my API Gateway via the web interface:
- Created a new API
- Created a new Resource with name "myclass" and path "/myclass"
- Created a new GET Method for the resource, using "Lambda Function" as the integration type, and pointing at my Lambda function.
I want to be able to call my Lambda function like this (without passing any specified headers in the request): https://xxx.execute-api.us-east-2.amazonaws.com/prod/myclass?paramA=valueA¶mB=valueB
I am unsure how to get my querystring parameters to pass through to the lambda function. No matter what I try, request.QueryStringParameters is always null.
What is the correct procedure from here?