HI,
I am trying to use ExtractVariables to extract a segment from a URI path.
As an example, a request might use this full URL:
The basepath of my proxy is postux
I want to extract brand (3rd segment from URIpath) as “abchd”.
We are using javascript to print the value
print(context.getVariable(“brand”)) ;
but it is not printing brand name .
Here’s the policy
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ExtractVariables continueOnError="false" enabled="true" name="Extract-Brand">
<DisplayName>Extract-Brand</DisplayName>
<Source>request</Source>
<URIPath>
<pattern ignoreCase="true">/api/{brand}/transactions/**</pattern>
</URIPath>
<!-- <VariablePrefix>urirequest1</VariablePrefix> -->
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
</ExtractVariables>