Reputation: 146
I want to capture response Header Location : specifically 100 number so i can use it as variable in another request. How can i do this ?
Request
Remote Address: 57.98.32.25:80
Request URL:http://57.98.32.25/new_events
Request Method:POST
Status Code:200 OK
Response Headers
Cache-Control:no-cache
Connection:close
Content-Encoding:gzip
Content-Length:105
Content-Type:text/html;
Date:Thu, 27 Aug 2015 06:37:31 GMT
Location:http://57.98.32.25/new_events/100
Server:Apache/2.2.15
Upvotes: 3
Views: 11351
Reputation: 168147
You can do it via Regular Expression Extractor configured as follows:
Response Headers
location
new_events/(\d+)
$1$
You may also need to switch "Apply to" value to "Main sample and sub-samples" if there are redirects and the Location header is not available in the main sample, use View Results Tree listener to determine it.
Refer extracted value as ${location}
or ${__V(location)}
where required.
Upvotes: 13