如何访问AWS API网关的path参数?
我在API网关中创build了一个基本的GET url; 用名为“name”的path参数。
我怎样才能访问这个名字参数? 我没有看到它在任何事件或背景下。
我错误的参数path的目的?
让我用我的游戏应用程序为例:
GET /api/v1/person @controllers.PersonController.list(limit: Int ?= 50, offset: Long ?= 0) GET /api/v1/person/$id<[0-9]+> @controllers.PersonController.getById(id: Long) GET /api/v1/person/$id<[0-9]+>/email @controllers.PersonController.getEmailByPersonId(id: Long)
这是使用AWS API网关实现的吗?
根据文档,您应该可以使用映射模板执行此操作: http : //docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-mapping-template-reference.html
修改他们的例子(底部附近的“示例请求和响应”)以适应你的URI,它将看起来像这样
//Resource: /api/v1/person/{id} //With input template(this is what your lambda will see in the event): { "id" : "$input.params('id')" "person" : $input.json('$.person') } //POST /api/v1/person/{id} { "person" : { "name": "bob" } }
- 使用节点MySQ的无服务器框架,错误PROTOCOL_INCORRECT_PACKET_SEQUENCE
- AWS Lambda网关API会提供错误消息
- Angular SPA与API Gateway的任何访问控制允许方法不一致
- 如何通过GET方法将API网关与Lambda集成
- 如何使用Spring Cloud和Netflix的Eureka注册Node应用程序
- AWS lambda api网关错误“格式错误的Lambda代理响应”
- 使用AWS Lambda和API网关来提供静态JavaScript?
- HTTP请求问题内部服务器错误
- AWS + API网关+ Lambda + Node.js操作对谷歌ApiAiApp