learn-aws-lambda icon indicating copy to clipboard operation
learn-aws-lambda copied to clipboard

How to Access HTTP request headers in Lambda function?

Open nelsonic opened this issue 9 years ago • 3 comments

see: http://stackoverflow.com/questions/31372167/how-to-access-http-headers-for-request-to-aws-api-gateway-using-lambda

nelsonic avatar Feb 04 '16 10:02 nelsonic

You should enable MODEL TEMPLATE for your lambda function. It is locate in the API gateway service then in the section INTEGRATION request apply the default model template available in the drop down menu.

chisNaN avatar Aug 08 '16 14:08 chisNaN

This worked for me: https://kennbrodhagen.net/2015/12/02/how-to-access-http-headers-using-aws-api-gateway-and-lambda/

Be sure to re-deploy the API Gateway with the new model setup

here avatar Sep 11 '16 23:09 here

Which doesn't work for MIME messages when you have a flexible Content-Type as in Content-Type: multipart/related; boundary="----=_Part_0_1057468716.1585071599240"; type="application/soap+xml"; charset=UTF-8, as the model template requires a fixed Content-Type

phax avatar Mar 24 '20 19:03 phax