Skip to content

Instantly share code, notes, and snippets.

@resistancecanyon
Forked from kelvinn/cmd.sh
Last active September 27, 2016 06:50
Show Gist options
  • Save resistancecanyon/897efe173bb594d231338949ebc4a05b to your computer and use it in GitHub Desktop.
Save resistancecanyon/897efe173bb594d231338949ebc4a05b to your computer and use it in GitHub Desktop.
Example of using Apache Bench (ab) to POST JSON to an API
# 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/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment