Skip to content

Instantly share code, notes, and snippets.

@smt116 smt116/wrk_post.lua
Created Mar 18, 2015

Embed
What would you like to do?
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
You can’t perform that action at this time.