1
0
mirror of https://github.com/wg/wrk synced 2026-05-17 11:12:32 +08:00

add a few example scripts

This commit is contained in:
Will
2013-12-07 14:09:44 +09:00
Unverified
parent 7763ce3c9b
commit 44aa1b4aab
7 changed files with 51 additions and 2 deletions
+18
View File
@@ -0,0 +1,18 @@
-- 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