简体   繁体   English

如何在Java AWS Lambda函数中获取路径参数值

[英]How to get the path param value in java AWS Lambda function

URL: /test/{userName} 网址: /test/{userName}

In AWS Lambda function , How can I get the {username} path parameter value. AWS Lambda函数中 ,如何获取{username}路径参数值。 I am calling lambda function through AWS API gaetway . 我正在通过AWS API gaetway调用lambda函数。

If you are using AWS integration type: 如果您使用的是AWS集成类型:

Use a mapping template to send $input.params('username') property in the request body to your Lambda function. 使用映射模板将请求正文中的$ input.params('username')属性发送到Lambda函数。

If you are using AWS_PROXY integration type: 如果您使用的是AWS_PROXY集成类型:

You can access the path parameters via the "pathParameters" property of the incoming event . 您可以通过传入事件的“ pathParameters”属性访问路径参数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM