简体   繁体   中英

Why am I getting gibberish for http request body?

I'm trying to create a Slack bot that uses AWS lambda api gateway as the backend. However, the event payload I'm getting has an incomprehensible payload body.

In the example im following the body should be like

Am I supposed to decode the body somehow?

I'm following this guide exactly but I'm implementing the lambda function in python. I just don't know why my event isn't even getting the proper body. https://youtu.be/XgFVzBNgidQ

The payload isn't gibberish it's just base64-encoded and can be decoded using a library or method that supports base64-decoding. Here's the decoded value:

token=xxxxxxxxxxxxxxxxx&team_id=TSQ1S1YKB&team_domain=dankscape&channel_id=CSQ1S2D2M&channel_name=bot&user_id=UT078Q6BA&user_name=the.dankscape&command=%2Fecho2&text=hi+spec&response_url=https%3A%2F%2Fhooks.slack.com%2Fcommands%2FTSQ1S1YKB%2F921356743414%2Fv3ltAkqOhjOU8HyLiOiMmJkG&trigger_id=908962933297.908060066657.da505f8459f1102a090444d8934e188b

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM