I am new to AWS, I am getting {"message": "Internal server error"}
while running the Lambda function with API Gateway in Postman.
I have checked the CloudWatchLogs
, there is no error showing in the logs. But Postman returning {"message": "Internal server error"}
this error.
It happens when you don't return the correct API Gateway format.
Try to return this in your Lambda:
def lambda_handler(event, context):
return {
"statusCode": 200,
"body": "{'Test': 'Test'}",
"headers": {
'Content-Type': 'text/html',
}
}