I've copied and modified the sample code for extracting a variable from a query parameter:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <ExtractVariables async="false" continueOnError="true" enabled="true" name="Extract-Variables-Query-Param"> <DisplayName>Extract Variables - Query Param</DisplayName> <Source>request</Source> <QueryParam name="appt_number"> <Pattern ignoreCase="true">{appt_number}</Pattern> </QueryParam> <VariablePrefix>queryinfo</VariablePrefix> <IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables> </ExtractVariables>
And this is the URL itself:
http://myproxy.apigee.net/basepath/?appt_number=123
Unfortunately, the data "123" from the query param "appt_number" isn't being picked up. When I try and find the variable queryinfo.appt_number in a trace, it's empty:
- all you see is the variable prefix.
As it's an almost verbatim copy of the sample, it should work - so what's missing?
Solved! Go to Solution.
You must remove prefix variable to see your value in trace. Although it is not necessary to get query param value using extract variable. You can access it directly like request.queryparam.<param_name>