How to use session API for headers


Hi guys

I noticed that .header can use session API as a lambda function to inject dynamic header information to each virtual user, but I need to pass a series of headers with dynamic information related to each other. So is there some way to use session API on .headers? I checked the doc about session API, didn’t quite understand how to programmatically use the session API for data injection, thanks!

Previously I used feeder to inject dynamic headers but when I need to pass the response from the previous request to the next feeder (bookingNo), it failed. That’s why I want to try on session API

No, it’s currently not possible to pass a bunch of headers with a function, only individually.

Thanks for the answer, just wonder how exactly feeder and session API work programmatically to inject data for different virtual users and what’s the difference between these two methods in terms of Gatling performance, cheers