Hi
I have to replace the actual target endpoint url using javascript policy.
I am having js file which takes the target url below
var targetUrl = context.getVariable(“target.url”);
But problem is that it doesn’t include the resource name which is actually sent with Proxy Endpoint URL
Suppose, I have one API Proxy with many resources
API Proxy Endpoint - http://test.com:9002/legacy_api/v1/test
Target Endpoint - http://ip:8080/wfc/restcall/legacy_api/v1/test
Also I have resource name - RetrieveAllNames
When I hit the API Proxy on Gateway like below
http://test.com:9002/legacy_api/v1/test/RetrieveAllNames
Value of targetUrl = context.getVariable(“target.url”) gives only
http://ip:8080/wfc/restcall/legacy_api/v1/test not the whole
http://ip:8080/wfc/restcall/legacy_api/v1/test/RetrieveAllNames
So how to get the resource name also in the target.url in JS file
Thanks