I searched on AWS Lambda documentation but couldn't find an answer to my problem.
Is there a way I can access the entire request body from a Lambda function (written in node.js)?
The event
parameter only seems to contain parsed JSON properties.
Your request body needs to be in XML or JSON in order to be able to access it in your Lambda
function. You need to specify how it's processed/mapped and passed through in Integration Request
section of the API Gateway
dashboard.
You can access the request body in AWS Lambda once you expose it in a Body Mapping Template.
Integration Request
Integration Request
, open the Body Mapping Templates
panelContent Type
of application/json
application/json
item {
"body" : $input.json('$')
}
After that you can access the request body as event.body
in your Node.js Lambda Function.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With