【发布时间】:2017-05-08 02:06:22
【问题描述】:
我有一个使用 GET 请求从 API 网关调用的 C# 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 函数来实现这一目标?
谢谢,
克里斯
【问题讨论】:
标签: c# amazon-web-services aws-lambda