Skip to content

Instantly share code, notes, and snippets.

@vchimishuk
Forked from jeffweiss/post_message.lua
Created December 20, 2016 16:34
Show Gist options
  • Save vchimishuk/32b9be9c87ab4d27d8e4c8902dbf02f2 to your computer and use it in GitHub Desktop.
Save vchimishuk/32b9be9c87ab4d27d8e4c8902dbf02f2 to your computer and use it in GitHub Desktop.
Sending POSTs to Elixir Phoenix using wrk or wrk2
wrk.method = "POST"
-- this assumes that we're sending to a html form endpoint with csrf protection disabled
-- wrk.body and wrk.headers would be different if we were sending a JSON payload to a JSON API endpoing
wrk.body = "message[body]=wat"
wrk.headers["Content-Type"] = "application/x-www-form-urlencoded"
./wrk -s post_message.lua -t20 -c100 -d30s --latency http://localhost:4000/documents/1/messages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment