Can I obtain 12345 from http://api.example.com/weather/12345 by message assign policy? I can get /12345 as a {proxy.pathsuffix} variable. However it contains "/" that I want to remove.
Solved! Go to Solution.
Dear @Sokichi Fujita ,
Ideally, You need to use extract variables policy to extract the id from URL instead of Assign Message policy.
<ExtractVariables name="ExtractVariables-1"> <Source>request</Source> <URIPath> <Pattern ignoreCase="true">/weather/{id}</Pattern> </URIPath> <VariablePrefix>urirequest</VariablePrefix> <IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables> </ExtractVariables>
In above example, the urirequest.id variable is set to whatever appears in the URI path after "/weather/".
Dear @Sokichi Fujita ,
Ideally, You need to use extract variables policy to extract the id from URL instead of Assign Message policy.
<ExtractVariables name="ExtractVariables-1"> <Source>request</Source> <URIPath> <Pattern ignoreCase="true">/weather/{id}</Pattern> </URIPath> <VariablePrefix>urirequest</VariablePrefix> <IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables> </ExtractVariables>
In above example, the urirequest.id variable is set to whatever appears in the URI path after "/weather/".
Hi @Anil Sager,
Thank you. I could get the {id] by using extract variables policy.
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |