How to access HTTP headers for request to AWS API Gateway using Lambda?

前端 未结 7 1996
终归单人心
终归单人心 2020-11-28 23:38

I see in the API Gateway FAQ that it is possible to access the request headers sent to the API Gateway...

If you already utilize OAuth tokens or any o

7条回答
  •  春和景丽
    2020-11-29 00:20

    You need to create input mapping inside Integration Request panel on the dashboard screen describing your API method.

    Following code translates name query input parameter into Lambda Event input object:

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

    Screenshot:

    API Dashboard screenshot

    You can find more info about this in the original API Gateway to Lambda input thread on AWS Forums.

提交回复
热议问题