Reputation: 127
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?
Upvotes: 0
Views: 418
Reputation: 111
I think python's Json Boolean value has to be either True or False (First letter capital).
Try json.dumps({'success': True})
Upvotes: 1