还有其他关于此错误的问题,但他们正在寻找访问查询参数的方法,这不是我的方案。
在测试控制台的errorMessage字段中测试我的简单GET请求失败如下:
Can not deserialize instance of java.lang.String out of START_OBJECT token\n at [Source: lambdainternal.util.NativeMemoryAsInputStream@6bdf28bb; line: 1, column: 1
我的lambda函数是一个简单的Java类,它有一个静态方法get,它接受一个参数:路径param中的id。
例如,
我有一个C#方法,我已经成功地将它发布为AWS函数。看起来是这样的:
public class MyClass
{
public async Task<APIGatewayProxyResponse> Test(APIGatewayProxyRequest request, ILambdaContext context)
{
return new APIGatewayProxyResponse
{
Body = "Body: " + request.Body
我有一个通过GET请求从C#网关调用的API函数。
[LambdaSerializer(typeof(Amazon.Lambda.Serialization.Json.JsonSerializer))]
public ResponseModel MyFunction(RequestModel request)
{
return new ResponseModel { body = "Hello world!" };
}
public class RequestModel
{
[JsonProperty("a")]
public str