In Lambda function, I am returning output as below
output = {
"statusCode": 200,
"headers": {'Content-Type': 'application/json'},
"body": json.dumps({'success': true})
}
#json.dumps('Email sent! Message ID:' + response['MessageId'])
return output
and it returns following error message:
{
"message": "Internal server error"
}
However if I change following line
json.dumps({'success': true})
to
json.dumps('Email sent! Message ID:' + response['MessageId'])
It works fine. I want to return a json back, what needs to be done?