#bogo-webhook-awslambda
1 messages ยท Page 1 of 1 (latest)
bogo-webhook-awslambda
Hey @rigid temple AWS Lambda makes this really tricky because it touches the raw payload
yup, I'm aware!
We have some old obscure docs internally about this where we recommend something that looks like { "method": "$context.httpMethod", "body": $input.json('$'), "rawBody": "$util.escapeJavaScript($input.body).replaceAll("\\'", "'")", "headers": { #foreach($param in $input.params().header.keySet()) "$param": "$util.escapeJavaScript($input.params().header.get($param))" #if($foreach.hasNext),#end #end } }
I'm hoping you know what that does/mean and can tweak it your way? ๐
I'll try it! Do you know if there's anything that I have to do if there's an Apigateway in front of it and how that handles raw bodys?
I have never used this so I'm not sure. But in our internal docs we say: ```First, in API Gateway, users should set up a Body Mapping Template like this:
Content-Type: application/json (just this โ do not include ; charset=utf-8 afterwards)
Template contents:``` (and then that's what I shared above that's the content)
do you know where I'd put this code?
no, I've never used this tool. It's somewhere in the "Body Mapping Template"
do you know how to remove the "charset=utf-8", I'm not including it in my swagger but when i log the "events", here is the response i get
it seems to be using charset-utf8 on the headres
as well as rawBody not showing up
I'm sorry I do not, I've never used any of this and neither has anyone on my team
You might need to ask AWS' own support team in that case
is there more info on the that internal doc that you can provide?
no I shared everything