I am new to apigee.
I am trying to make a post call in apigee with queryparameters.
The flow is below.
Client send request --> verify API key ---> extract payload --> remove access token --> call target endpoint conditional based on POST
I am using curl command to make POST call.But issue is while calling target endpoint its taking as /GET call and condition is evaluating to false.
Apigee can convert in inbound POST to a back-end GET. In Apigee that means using a policy to rebuild the call, to use a GET method (verb) on your target back-end, when you need to receive a POST from your upstream calling client. You will need to use the AssignMessage policy. These product docs are exactly what you need to review: https://docs.apigee.com/api-platform/reference/policies/assign-message-policy#set-verb
Example, AssignMessage:
<AssignTo type="request" createNew="false"/>
and
<Set> ... <Verb>GET</Verb>
Note though that when converting the method (verb) from POST to GET, the policy will not automatically convert the POST's form parameters to query parameters. You will need to use the <Add>
and/or <Remove>
functionality of the AssignMessage policy to manipulate the message further. Example use in the AssignMessage policy to add the queryparams, referencing the formparams:
<Add>
<QueryParams>
<QueryParam name="q1">{request.formparam.q1}</QueryParam>
</QueryParams>
</Add>
Credit to user Michael Russo for his Answer about this from eight years ago.