I have a C# lambda function that is called from API gateway using a GET request.
[LambdaSerializer(typeof(Amazon.Lambda.Serialization.Json.JsonSerializer))]
publ
Try putting this in your RequestModel
:
public class RequestModel
{
[JsonProperty("queryStringParameters")]
public Dictionary<string, string> QueryStringParameters { get; set; }
}
Then access the query string values as request.QueryStringParameters["foo"]
, etc.
If you checked the Use Lambda Proxy integration
box in API Gateway for your resource and method (which I suspect you did, since you've structured your response object with the statusCode
, headers
, and body
fields), the corresponding request object structure is documented in Input Format of a Lambda Function for Proxy Integration, buried deep in AWS's documentation. There are also other fields available like the body, headers, HTTP verb, etc.
My understanding is that you can also create a custom Payload Mapping to map different parts of the request to a custom JSON object, but doing so requires more configuration than using the built-in Lambda Proxy.