Aws Api Gateway Integration Request How to append a property to request body?

女生的网名这么多〃 提交于 2019-12-02 05:58:58

You can use body mapping template in the integration request section and get request body and query strings. Construct a new JSON at body mapping template, which will have data from request body and query string. As we are adding body mapping template your business logic will get the JSON we have constructed at body mapping template.

Inside body mapping template to get query string please do ,

$input.params('querystringkey')

For example inside body mapping template,

#set($inputRoot = $input.path('$'))
{
"firstName" : "$input.path('$.firstName')",
"lastName" : "$input.path('$.lastName')"
"language" : "$input.params('$.language')"
}

Please read https://aws.amazon.com/blogs/compute/tag/mapping-templates/ for more details on body mapping template

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!