Created
November 18, 2015 06:20
-
-
Save Rican7/b585cde09fa0efe2820c to your computer and use it in GitHub Desktop.
Perform a cURL variable path request in a loop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
readonly ACCESS_TOKEN="" | |
readonly IDS=( | |
1 | |
2 | |
3 | |
) | |
for id in ${IDS[@]}; | |
do | |
echo -e "Doing work '${id}'... \c" | |
curl --silent --fail -o /dev/null \ | |
-X POST \ | |
-H "Authorization: Token ${ACCESS_TOKEN}" \ | |
"https://api.example.com/resource/${id}/meta" | |
echo "Done." | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment