can we have multiple http method in single resource in API gateway in AWS?

落爺英雄遲暮 提交于 2021-01-29 05:37:00

问题


I am trying my hands with API Gateways in AWS.

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.

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


回答1:


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.

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.

More information is available here.



来源:https://stackoverflow.com/questions/62871941/can-we-have-multiple-http-method-in-single-resource-in-api-gateway-in-aws

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!