How to pass headers from AWS API Gateway

我怕爱的太早我们不能终老 提交于 2019-12-24 19:15:26

问题


I'm passing the addition key-value pairs from lambda function, same as mention in aws labs. Then in API Gateway I have setup the body mapping templates in integration request. (Check this).

But when request goes to the endpoint (PHP) then I'm unable to get any data. It is empty array print_r($_REQUEST);

I checked cloudWatch this is what it is showing. Endpoint request body after transformations: { "userData" : "{"city":"USA","Name":"Sanket","id":3}" }

Additional info - When I print print_r($_REQUEST); then it is empty array but when I print $request->getContent(); it shows all the data.

UPDATE - I Additional information here


回答1:


You have mentioned that you have setup body mapping template in integration request. If you want to integrate a response then you should setup it in integration response, not in integration request.



来源:https://stackoverflow.com/questions/46954296/how-to-pass-headers-from-aws-api-gateway

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