Created
March 18, 2015 14:52
-
-
Save smt116/acaf11f50eb46428b4f3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function string.random(length) | |
if length < 1 then return nil end | |
local str = "" | |
for i = 1, length do | |
n = math.random(32, 122) | |
if (n > 32 and n < 48) or (n > 57 and n < 65) or (n > 90 and n < 97) then n = math.random(97, 122) end | |
str = str .. string.char(n) | |
end | |
return str | |
end | |
wrk.method = "POST" | |
wrk.body = "title=" .. string.random(32) .. "&body=" .. string.random(1024 * 4) | |
wrk.headers["Content-Type"] = "application/x-www-form-urlencoded" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment