我有一个使用GET请求从API网关调用的C#lambda函数。如何将AWS API网关查询字符串映射到C#AWS Lambda函数?
[LambdaSerializer(typeof(Amazon.Lambda.Serialization.Json.JsonSerializer))]
public ResponseModel MyFunction(RequestModel request)
{
return new ResponseModel { body = "Hello world!" };
}
public class RequestModel
{
[JsonProperty("a")]
public string A { get; set; }
[JsonProperty("b")]
public string B { get; set; }
}
public class ResponseModel
{
public int statusCode { get; set; } = 200;
public object headers { get; set; } = new object();
public string body { get; set; } = "";
}
如何发送到API网关在MyFunction
的RequestModel
参数的查询字符串参数映射?
我已经用参数调用了该函数,但它们似乎并没有通过。有没有等待用C#lambda函数实现这一点?
感谢,
克里斯