1 -- example script that demonstrates response handling and 2 -- retrieving an authentication token to set on all future 3 -- requests 4 5 token = nil 6 path = "/authenticate" 7 8 request = function() 9 return wrk.format("GET", path) 10 end 11 12 response = function(status, headers, body) 13 if not token and status == 200 then 14 token = headers["X-Token"] 15 path = "/resource" 16 wrk.headers["X-Token"] = token 17 end 18 end