How to allow only GET and PATCH request using apigee?

I am using apigee to allow only GET and PATCH request. I want to raise a fault for all other requests with error code 403. For that I have used Raised Fault policy.

    <PreFlow name="PreFlow">
       <Request>           <Step>              <Name>RF-only-GET-PATCH</Name>                <Condition>(request.verb !="GET") || (request.verb !="PATCH")</Condition>                </Step>               </Request>            <Response/>        </PreFlow>
    Also tried following combinations :
     <Condition>(request.verb !="GET") || (request.verb !="PATCH")</Condition>     <Condition>(request.verb !="GET") or (request.verb !="PATCH")</Condition>     <Condition>((request.verb !="GET") || (request.verb !="PATCH"))</Condition>
this is not worked.

What should be the condition to raise the fault : RF-only-GET-PATCH ?

Solved Solved
0 2 1,016
1 ACCEPTED SOLUTION

Did you try using this?

<Condition>(request.verb !="GET") and (request.verb !="PATCH")</Condition>

View solution in original post

2 REPLIES 2

Did you try using this?

<Condition>(request.verb !="GET") and (request.verb !="PATCH")</Condition>

Thanks.

its working