Reputation: 77
I am passing the headers from the response of login API to the next authorized API.
I have to pass the SRToken, Id1, Id2, and Id3 in the header so, I have added JSON extractor for all these headers and set the values fro them. Below screenshot shows how I have extracted values. Example
In this way I have extracted values fro Id1, Id2 and Id3. Then I have used Debug Sampler to view the values are stored? But I am not getting the values here.
I have also tried using Regular Expression Extractor
Upvotes: 0
Views: 234
Reputation: 499
You need to extract based on Response Header field. Use Regular Expression extractor as a child of your Login Sampler [from whose response these fields need to be extracted]. Sample Regular Expression is shown where I am extracting digit [change Regular Expression to (\w+) if you want to extract words. or any regex will work].
Most important here is to select "Field to check as Response Headers"
Upvotes: 1
Reputation: 58774
JSON is irrelevant in Headers,
You should use Regular Expression Extractor with Field to check
set Request Headers
and use regular expression for getting the needed values
Upvotes: 0