Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Unable to store value in variable using Extract Variable Policy

I am using extract variable policy and i want to extract a variable through JSON response, The variable i want to extract is "HOST" but when i trace my policy i am unable to get value in my defined

3669-apigee-extract.jpg

variable.

Following is my Extract Variable Policy:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ExtractVariables async="false" continueOnError="false" enabled="true" name="EV_origion">
    <DisplayName>EV_origion</DisplayName>
    <IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
    <JSONPayload>
        <Variable name="Host">
            <JSONPath>$.headers[4].Host</JSONPath>
        </Variable>
    </JSONPayload>
    <Source>response.content</Source>
    <VariablePrefix>myHost</VariablePrefix>
</ExtractVariables>
Solved Solved
0 5 146
1 ACCEPTED SOLUTION

Not applicable
@Haider Imran

Could you please try with this $.headers.Host

I hope it will work.


View solution in original post

5 REPLIES 5