Limiting API to certain HTTP Methods (Verbs)

Hi Friends,

Under RouteRule, Condition, I have only allowed(request.verb = "POST"). When I tried to do a PUT or PATCH in Postman, it returns:

{ "fault": { "faultstring": "Unable to route the message to a Target Endpoint", "detail": { "errorcode": "messaging.runtime.RouteFailed" } } }

But when I tried GET, it does not even hit my Apigee. Postman says "Could not get any response There was an error connecting to...."

I like to understand if whether Apigee Edge could completely block other other verbs (GET, PUT, PATCH) other than the one I designated i.e., POST?

Thank you.

Nathan Aw (Singapore)

0 1 491
1 REPLY 1

Maybe you can add a Conditional FLow on the Proxyendpoint and add a single Raise Fault policy with Conditions.

<Step>RF-Invalid-Verb</Step>
<Condition>request.verb != POST</Condition>

If you have multiple conditional flows, make sure that this Conditional flow is placed just before the PostFlow of Proxy endpoint.

In Raise Fault add the custom error info.

Which this the proxy will only allow POST calls to hit TargetEndpoint.