I'm working with a AWS API Gateway that receives a {name} as prints out "Hello {name}" but I'm unable to get this trivial task right.
Any pointers what I could be doing wrong? How the can I get the {name} from the URL?
API Gateway: https://xxxxxx.execute-api.eu-west-1.amazonaws.com/dev/John
Python AWS Lamba code:
def lambda_handler(event, context):
name = event["requestContext"]["resourcePath"]
response = "Hello " + name
return {
'statusCode': 200,
'body': response
}
The expected output:
{
"statusCode": 200,
"body": "Hello John"
}