def lambda_handler()

in sam-code/echo_api/echo_raw.py [0:0]


def lambda_handler(event, context):    
    print(event)
    if "body" in event:
        return {
            'statusCode': 200,
            'headers': event.get('headers',{}),
            'body': event.get('body',{}),
            'isBase64Encoded': event.get('isBase64Encoded',False)
        }
    else:
        return {
            'statusCode': 400,
            'headers': { 'content-type': 'text/plain'},
            'body': 'Error: nothing to echo. Are you using the right endpoint',
            'isBase64Encoded': False
        }