There is HTTP Header Manager component, which allows to set some HTTP headers when HTTP Sampler is used.
I need to intercept response header with certain name, remember it in some variable and use the saved value in all requests (override existing values, for example I recorded 100500 requests with HTTP Proxy and don’t want to alter all requests with providing the variable expression).
So the flow is something like below:
- send N requests to server
- in some response there is the header X
- send M requests
- send request with saved value of header X
- in some response value of header X changes, and subsequent requests with header X will use the new saved value
Shall I create some controller for such behavior or there is something ready-to-use? didn’t spot it yet.
The Regular Expression Extractor is your friend. You can tell it to parse the headers as well as the body.