Dee*_*ram 1 amazon-web-services amazon-cloudwatch aws-lambda aws-api-gateway amazon-cloudwatchlogs
我是AWS新手,{"message": "Internal server error"}在Postman中使用API Gateway运行Lambda函数时遇到了麻烦。
我已经检查了CloudWatchLogs,日志中没有显示错误。但是邮递员返回了{"message": "Internal server error"}这个错误。
当您没有返回正确的API网关格式时,就会发生这种情况。
尝试将其返回到您的Lambda中:
def lambda_handler(event, context):
return {
"statusCode": 200,
"body": "{'Test': 'Test'}",
"headers": {
'Content-Type': 'text/html',
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
66 次 |
| 最近记录: |