in Uncategorized

Apache Bench (ab) to POST JSON to an API

Example of using Apache Bench (ab) to POST JSON to an API

  1. Create a JSON file test.json

$ cat test.json json='{ "timestamp" : 1484825894873, "test" : "test"}'
  1. Run the test

ab -c 10 -n 1000 -p  test.json -T application/x-www-form-urlencoded  https://example.com/test