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.
相關內容
- 已提問 1 年前
- 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