lander/bench/post.lua

25 lines
521 B
Lua
Raw Permalink Normal View History

2023-05-31 20:39:06 +02:00
chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
request = function()
path = "/s/"
-- for i = 1,16 do
-- local rint = math.random(1, #chars)
-- path = path .. chars:sub(rint, rint)
-- end
body = "https://example.com/"
for i = 1,32 do
local rint = math.random(1, #chars)
body = body .. chars:sub(rint, rint)
end
wrk.path = path
wrk.method = "POST"
wrk.body = body
wrk.headers["X-Api-Key"] = "test"
return wrk.format()
end