val headers1 = Map(
"SomeHeader1" -> "${SomeHeader1}",
"SomeHeader2" -> "${SomeHeader2}",
"SomeHeader3" -> "${SomeHeader3}")
val headers2 = Map(
"SomeHeader4" -> "${SomeHeader4}",
"SomeHeader5" -> "${SomeHeader5}",
"SomeHeader6" -> "${SomeHeader6}")
val req1 = http("req")
.get("/some/path")
.headers(headers1)
val req2 = http("req")
.get("/some/path")
.headers(headers2)
req1 and req2 are the same except headers, so I want to have a common request which will sent either headers1 or headers2 in .headers section depending on some session variable, which I will define on scenario level.
val commonReq = http("req")
.get("/some/path")
.headers(hFunction())
Is it possible to get a session variable into a function like def hFunction(): Map[String, String] = {}, which will set appropriate header depending on some logic?