Not able to extract response dynamic header value from target response

from target response header I am getting the variable named “Tr-ui” from the target. But I am not able to extract that variable using the extract variable policy. Value of that variable will be JSON.

Below is the configuration. But I am not able to see the extra header in trace itself

response {extraHeaderValue} targetHeader true

Can you please post your trace?

Are you able to see the header in the backend response variable?

yes I am able to see in target response. But it is not showing in extract policy output. In extract variable policy, under the variables section NOTHING Is showing. i mean the targetHeader.extraHeaderValue

I am also having the same issue, could you please share how you fix this issue.

You can directly try the variable as response.header.Tr-ui

Please check this.

My requirement is to extract the content-range from the response header, from the target i recevied as below

keep-alive 569 count 1-1/1 application/json;charset=UTF-8 Tue, 20 Oct 2020 22:17:04 GMT nginx max-age=15768000; includeSubDomains 10160b61-080c-4c00-6aa4-622b1884f36a

i tried below in the assign policy.

{response.header.content-range}

I tried with extract variable also,

{content-range} true response

but both are not working.

You have to extract using extract variable policy xpath not using header.

Your source will be the header, and using xpath XML extraction you have to extract the value.

could you please help with the Xpath and extract variable syntex is correct or not

/ResponseMessage/Headers/*/{content-range}

Input Header:

Header name=“Connection”>keep-alive

569 count 1-1/1 application/json;charset=UTF-8 Tue, 20 Oct 2020 22:17:04 GMT

use the below code and you will get the value you want in the variable content-range. It should be attached in the response.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ExtractVariables async="false" continueOnError="false" enabled="true" name="Extract-Variables-1">
    <DisplayName>Extract Variables-1</DisplayName>
    <Properties/>
    <IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
    <Source clearPayload="false">response</Source>
    <XMLPayload stopPayloadProcessing="false">
        <Namespaces/>
        <Variable name="content-range">
            <XPath>//ResponseMessage/Headers/Header[3]</XPath>
        </Variable>
    </XMLPayload>
</ExtractVariables>