我正在尝试创建一个 API 端点来在我的移动应用程序中执行我的 AWS Lambda 函数。当我创建自定义 API 并测试 POST 方法时,我得到正确的响应代码 200 并且正确的字符串短语返回:"The name is {input}"
。
但是,当我尝试将此 API 导入我的项目时,它不会出现在 SDK 中。当我尝试通过 Mobile Hub 创建 API 时,我遵循完全相同的步骤,但是当我输入 POST 方法时,我收到以下错误消息:
Endpoint response body before transformations: "The name is InputName"
Fri Mar 10 17:39:33 UTC 2017 : Endpoint response headers: {x-amzn-Remapped-Content-Length=0, x-amzn-RequestId=8599f413-05b8-11e7-92d2-75672f730ae7, Connection=keep-alive, Content-Length=23, Date=Fri, 10 Mar 2017 17:39:32 GMT, Content-Type=application/json}
Fri Mar 10 17:39:33 UTC 2017 : Execution failed due to configuration error: Output mapping refers to an invalid method response: 200
Fri Mar 10 17:39:33 UTC 2017 : Method completed with status: 500