Get POST parameters from Request ( AWS API Gateway - Lambda - Node.JS - Claudia.JS )

164
February 03, 2018, at 02:42 AM

Im developing a Lambda API in my AWS API Gateway. Im trying to retrieve some parameters from a POST call, but the body comes as a text instead of a JSON, or any type of collection.

I was advised to make the calls using a application/json content type, and also advised to use 'lambda proxy integration', but none of those configurations changed the response object.

api.post('/login', function(request) {  
return new Promise((resolve, reject) => {
     console.log(request.body)

Log return:

----------------------------289602992579875509977825
Content-Disposition: form-data; name="myformdata"
666666666666
----------------------------289602992579875509977825
Content-Disposition: form-data; name="otherparameter"
6666666666

There is any way I can get a collection of the parameters sent by client?

There is any solution for this using only lambda functions?

Some people are saying that is possible to get post parameters like a "query-string" (ex:one=1&two=2..). Im using PostMan for testing, but this is not working.

Thanks.

Claudia JS Reference: https://github.com/claudiajs/claudia-api-builder/blob/master/docs/request-object.md

READ ALSO
Run linked package instead of installed, npm

Run linked package instead of installed, npm

I'm sorry if this question kind of nooby

146
Does Node@6 support puppeteer api to generate PDF

Does Node@6 support puppeteer api to generate PDF

I have successfully generated PDF using puppeteer api with latest version of Node ie Node@8

227
Webpack setup for non-framework project

Webpack setup for non-framework project

How to use Webpack for minifying my project what is built on Express Generator?

215
Why is requiring webpack throwing errors?

Why is requiring webpack throwing errors?

If I have a file I try to run webpack on, which only contains var webpack = require('webpack'); I get more errors than I should paste here

219