问题
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