Wrk: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
Line 14: Line 14:


==Playground==
==Playground==
<source lang="bash">
<source lang="lua">
cat <<'EOF' > ~/Documents/wrk-playground/test-urlencoded-data.lua
cat <<'EOF' > ~/Documents/wrk-playground/test-urlencoded-data.lua
wrk.method = "POST"
wrk.method = "POST"
-- post form urlencoded data
wrk.body = "width=2&height=2"
wrk.body = "width=2&height=2"
wrk.headers['Content-Type'] = "application/x-www-form-urlencoded"
wrk.headers['Content-Type'] = "application/x-www-form-urlencoded"

Revision as of 02:55, 15 January 2024

# macos
brew install wrk
wrk --help

# debian / ubuntu
sudo apt install build-essential libssl-dev git -y
git clone https://github.com/wg/wrk.git && cd wrk
sudo make && sudo cp wrk /usr/local/bin
ls -lah /usr/local/bin|grep wrk
sudo make clean
wrk --help

Playground

cat <<'EOF' > ~/Documents/wrk-playground/test-urlencoded-data.lua
wrk.method = "POST"
wrk.body = "width=2&height=2"
wrk.headers['Content-Type'] = "application/x-www-form-urlencoded"
EOF

References