Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the original request URI in api gateway?

From a lambda implemented api gateway resource, how to get the original request URI. Or even just the original path?

Lacking a better way I'm currently using the following three variables that I pass down to the lambda using the default request template:

$context.resourcePath   contains the path with variable names   ex: "/blah/{var}"
$input.params().path    contains the variable names and values  ex: {"var":"something"}
$context.stage          contains the stage                      ex: "prod"

That's quite a hassle since it requires path variable substitution to get the original call path:

/prod/blah/something

How can I get the original URL or URI?

like image 843
Daniel Sperry Avatar asked Jun 27 '16 15:06

Daniel Sperry


1 Answers

I'm not finding anything in the documentation that lets you get the original call URI. I can add a feature request to consider adding it. Can you describe your use case. Why do you want to get the original URI?

like image 171
MikeD at AWS Avatar answered Nov 11 '22 07:11

MikeD at AWS