mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
416 B
19 lines
416 B
11 years ago
|
-- example script that demonstrates response handling and
|
||
|
-- retrieving an authentication token to set on all future
|
||
|
-- requests
|
||
|
|
||
|
token = nil
|
||
|
path = "/authenticate"
|
||
|
|
||
|
request = function()
|
||
|
return wrk.format("GET", path)
|
||
|
end
|
||
|
|
||
|
response = function(status, headers, body)
|
||
|
if not token and status == 200 then
|
||
|
token = headers["X-Token"]
|
||
|
path = "/resource"
|
||
|
wrk.headers["X-Token"] = token
|
||
|
end
|
||
|
end
|