diff --git a/src/util/bash/client.sh b/src/util/bash/client.sh new file mode 100755 index 0000000..a51cf58 --- /dev/null +++ b/src/util/bash/client.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +host="${STRAWBOSS_HOST:-localhost:8180}" +if [ $# -eq 1 ]; then + url="$1" + method="GET" + data="" +elif [ $# -eq 2 ]; then + method="$1" + url="$2" + data="" +else + method="$1" + url="$2" + data="$3" +fi + +curl -X "$method" -H "Authorization: Bearer $(cat token.txt)" "http://${host}/api/$url" -d "$data" +echo "" +#echo "curl -X \"$method\" -H \"Authorization: Bearer $(cat token.txt)\" \"localhost:8180/api/$url\" | jq . "