POST request with wrk?

jackdbernier picture jackdbernier · Mar 7, 2013 · Viewed 30.6k times · Source

I started to try wrk. It's very simple to use and very hard on the server, but I don't know how to perform other kind of request such as POST. In fact, I don't even know if this tool allows it. The documentation is very minimal.

Thanks

Answer

Steve picture Steve · Nov 12, 2014

This is possible now. Here is an example https://github.com/wg/wrk/blob/master/scripts/post.lua.

wrk.method = "POST"
wrk.body   = "foo=bar&baz=quux"
wrk.headers["Content-Type"] = "application/x-www-form-urlencoded"

save this in a *.lua script and pass it into your command line test with the -s flag.