Could not parse request body into json: Unexpected character (\'-\' (code 45)) AWS Lambda + API + Postman

前端 未结 3 535
说谎
说谎 2021-01-03 23:48

I have been trying for a few days to get a parameter sent from the API Gateway in AWS to a Lambda function and I am having no success.

I decided to start from the b

3条回答
  •  半阙折子戏
    2021-01-04 00:38

    I just got stuck with this today.

    your mapping template is:

    { "name": "$input.params('name')" }
    

    AWS uses AWS Velocity templates, which; even though looks like JSON, is different.

    if you use

    { "name": $input.params('name') } // notice no quotes
    

    for the mapping template right at the integration request step, then it should work as expected.

提交回复
热议问题