I faced with problem when created simple bash script, so, my goal - fect jwt token and will use tokn in next query, For that first curl fetch credentials from login.json file and then set it in result.json, then reed token key and set it in variable tokenValue then I want to set it on bext curl in header but when I debugged I did not get Authorization header, why ? When I substitute the variable manually (like "Authorization: Bearer test_token") - it's worked, I faced with HTTP_AUTHORIZATION=Bearer test_token
curl --request POST -sL \
--url 'http://auth.loc/api/login'\
--output './result.json' \
--header "Content-Type: application/json" \
-d "@login.json" \
tokenValue=$(jq -r '.token' './result.json')
bearerToken="Authorization: Bearer "$tokenValue
echo 'fff' + $bearerToken
curl --request GET -sL \
--url 'http://qbee.local/api/v2/grouptree?_format=json'\
--output './grouptree_result.json' \
--header $bearerToken \
echo "$(cat grouptree_result.json)"
echo 'fff' + $bearerToken works fine, I faced with correct data in cli
CRin$bearerToken. On another note, maybe you should also add aContent-Typeheader.