在AWS的API网关的单个资源中可以有多个http方法吗? [英] can we have multiple http method in single resource in API gateway in AWS?

查看:65
本文介绍了在AWS的API网关的单个资源中可以有多个http方法吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用AWS中的API网关.

I am trying my hands with API Gateways in AWS.

这两种方法都具有相同的API端点.默认情况下,它正在调用为GET方法设置的lambda函数.

Both these methods have same API end point. By default it is calling lambda function set for GET method.

我觉得我在这里某个地方错过了一个把戏.

I feel i missed a trick here somewhere.

我应该为PUT方法创建其他资源还是在具有不同api端点的相同资源中使用它?

Should i create a different Resource for PUT method or we have it in same resource with different api end point ?

推荐答案

或者,您可以使用 ANY 方法,但是您将在Lambda中负责解释如何处理任何方法不想支持.

Alternatively to this you could use the ANY method but you will become responsible in your Lambda for interpreting how you handle any method you do not want to support.

您也可以在非代理资源上设置ANY方法.将ANY方法与代理资源相结合,您将针对API的任何资源为所有受支持的HTTP方法设置一个API方法.此外,后端可以发展而不会破坏现有的API设置.

You can set up the ANY method on a non-proxy resource as well. Combining the ANY method with a proxy resource, you get a single API method setup for all of the supported HTTP methods against any resources of an API. Furthermore, the backend can evolve without breaking the existing API setup.

更多信息可用 查看全文

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆