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 .
/v1/sync/test
if async=false
/v1/sync/test
if async=true
/v1/async/test
Thanks
@Gopi Krishna M
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>