Hi ,
I need to call different target server paths based on incoming request query param value.
My incoming query param is "async" which will have either "true" or "false".
based on the async query value, i need to change path of target .
<HTTPTargetConnection>
<LoadBalancer>
<Server name="target-server"/>
</LoadBalancer>
<Path>/v1/sync/test</Path>
</HTTPTargetConnection>
if async=false
<Path>/v1/sync/test</Path>
if async=true
<Path>/v1/async/test</Path>
Thanks
You can do it , there are multiple options to do it.
1:Use java script - Store the query param value, compare it and set the path i.e make it dynamic
JS: var q=context.getVariable("request.queryparam.async); compare "q" value with true/false and set it if(q== "true") context.setVariable(value,"v1/sync/test"); else context.setVariable(value,"v1/async/test"); TargetServer: <HTTPTargetConnection> <LoadBalancer> <Server name="target-server"/> </LoadBalancer> <Path>{value}</Path> </HTTPTargetConnection>
Hi @Gopi Krishna M - You can also do this with conditional RouteRules, described at https://docs.apigee.com/api-services/content/understanding-routes#determiningtheurlofthetargetendpoi....
User | Count |
---|---|
7 | |
2 | |
2 | |
1 | |
1 |