Skip to content

Instantly share code, notes, and snippets.

@ivansostarko
Last active May 29, 2017 13:44
Show Gist options
  • Save ivansostarko/145849421c03b03d4a93c8982b7d66ae to your computer and use it in GitHub Desktop.
Save ivansostarko/145849421c03b03d4a93c8982b7d66ae to your computer and use it in GitHub Desktop.
Testing Rest API using cURL
#!/bin/bash
# API description
echo "Started TIME:"
dt=$(date '+%d/%m/%Y %H:%M:%S');
echo "$dt"
for i in {1..1000000}
do
echo "Executed times: $i"
curl -H "X-Authorization: api-key" --data "param_1=one&param_2=2" https://api.com/v1
done
echo "Ended TIME:"
dt=$(date '+%d/%m/%Y %H:%M:%S');
echo "$dt"
@ivansostarko
Copy link
Author

How to run script:

  1. Rename file to .sh
  2. chmod +x curl_rest_api_testing.sh
  3. Edit values in curl
  4. Run script ./curl_rest_api_testing.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment