If my default target is http://httpbin.org
then my http://myproxy/get points to http://httpbin.org/get
can use route rule to take the following condition
<Condition>(proxy.pathsuffix MatchesPath "/mock")</Condition>
and make http://myproxy/mock to point http://httpbin.org/get
Solved! Go to Solution.
Route rules are used to route the request to different target systems altogether.
Example: If you want to route request like http://myproxy/fb to http://facebook.com and http://myproxy/google to http://google.com/ then you can use route rules in your proxy endpoint definition.
It looks like you just want to change the proxy.pathsuffix.
If you want to do so then create a conditional flow in your default target with the condition:
<Condition>(proxy.pathsuffix MatchesPath "/mock")</Condition>
And build target URL from a javascript callout like below:
var targetUrl = context.getVariable("target.url"); targetUrl = targetUrl + "/get"; context.setVariable("target.url", targetUrl);
Hope this is helpful!
Route rules are used to route the request to different target systems altogether.
Example: If you want to route request like http://myproxy/fb to http://facebook.com and http://myproxy/google to http://google.com/ then you can use route rules in your proxy endpoint definition.
It looks like you just want to change the proxy.pathsuffix.
If you want to do so then create a conditional flow in your default target with the condition:
<Condition>(proxy.pathsuffix MatchesPath "/mock")</Condition>
And build target URL from a javascript callout like below:
var targetUrl = context.getVariable("target.url"); targetUrl = targetUrl + "/get"; context.setVariable("target.url", targetUrl);
Hope this is helpful!
Thank you this helps a lot.