Quota limit for request methods 'get' or 'post' possible ?

raghav_pn
Participant I

I have a proxy to my API which has only two methods(POST & GET).Here I would like to apply the quota policy to the the method whose type is POST not to the GET.

0 3 271
3 REPLIES 3

@Raghav ,

Welcome to Apigee Community 🙂

It's possible & simple. Just add the condition to step element. You can find more about conditional reference in Apigee Docs here. Find more about out of the box variables that you can use in Api Proxy here in Apigee Docs.

<Step>
  <Condition>request.verb = "POST"</Condition>
  <Name>POLICYNAME</Name>
</Step>

Hi Anil , Thanks for the response..Just now handled in a flow condition as below:

<Flow name="IPQuotaValidation">

<Description>IPQuota Validation</Description>

<Request> <Step> <Name>IPQuota</Name> </Step> </Request>

<Response/>

<Condition>request.verb == "POST"</Condition>

</Flow>

@Raghav , You have added the condition to the entire flow. In above case, Any policy attached to the flow will be executed only if request method is post. If you would like to execute a policy on condition just add it inside step xml. Find more about flows here. If above answer resolved your issue, click on accept link below the answer.