Search code examples
httphttp-headersjmetercsrf

How to pass dynamic headers to the Http Request in jMeter?


There is a initial request going to the server which should retrieve the CSRF token and use that token id in post request header.

if that does not happen any POST requests to the server will return that error.

enter image description here

In the above screen shot, where token is the request to get the CSRF token Id, If I run the test this will generate one dynamic random token ID. But I need to pass the generated token ID in the post request through Header Manager. How can it possible. If yes, Can any one suggest some way to do that.


Solution

  • I resolved it by using User defined variables and Regular Expression Extractor to pass the parameters from one request sampler to another.