1 回答
- 最新
- 投票最多
- 评论最多
0
I'd recommend to print out the event object and understand whether the 'q' field is present or not.
For instance:
print('event:', json.dumps(event))
print('queryStringParameters:', json.dumps(event['queryStringParameters']))
Then you can verify whether some checks need to be done or defaulting to an empty string.
相关内容
- AWS 官方已更新 3 年前
Thanks for the answer, do i add the prints in my lambda handler? If i do this, i get no prints in my terminal?
just add print("xxx") in your handler and deploy. You can refer to your other question here as well: https://repost.aws/questions/QUfvLELnaIR9GEShYjEvtOZg/lambda-function-error-list-indices-must-be-integers-or-slices-not-str