Lambda event returns empty object
问题 I need to access event["pathParameters"] but the event returns an empty object. I created the function with AWS Cloud9 IDE. Here is my simple function: def handler(event, context): return { 'statusCode': 200, 'body': json.dumps(event), 'headers': { 'Content-Type': 'application/json' } } 回答1: event is set by the payload you're invoking the lambda with. When you use API gateway, that payload includes the key pathParameters , but when you're testing using the lambda console you'll need to form