Skip to content

Instantly share code, notes, and snippets.

@jeonguk
Created July 18, 2019 22:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeonguk/3e92617253da8f377c768e0d9e059db4 to your computer and use it in GitHub Desktop.
Save jeonguk/3e92617253da8f377c768e0d9e059db4 to your computer and use it in GitHub Desktop.
Apache Bench Post Sample
# post_loc.txt contains the json you want to post
# -p means to POST it
# -H adds an Auth header (could be Basic or Token)
# -T sets the Content-Type
# -c is concurrent clients
# -n is the number of requests to run in the test
ab -p post_loc.txt -T application/json -H 'Authorization: Token abcd1234' -c 10 -n 2000 http://example.com/api/v1/locations/
---
post_loc.txt
{
"foo": "bar"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment