Unable to store value in variable using Extract Variable Policy

haider_imran
Participant III

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 108
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

Not applicable
@Haider Imran

Could you please try with this $.headers.Host

I hope it will work.


Yes i did try this, still same result unfortunately.

@Haider Imran

Could you please comment the <VariablePrefix> part for time being and store the value in Variable name "Host" only test it.

It working fine for me.

@Umanng Goel

:Yes it is working now !! Great Thanks alot

@Haider Imran

Kindly accept the answer as it will be beneficial to other's. 🙂