Reputation: 600
How can I set the environment variable in request header for curl
curl --location --request POST 'test.example.com' \
--header 'Content-Type: application/json' \
--header 'access_token: "${SOME_ENV_TOKEN}"' \
--header 'Authorization: Basic Og=='
Not working.
Upvotes: 3
Views: 6277
Reputation: 196
Use --header "access_token: \"${SOME_ENV_TOKEN}\""
The '
quotes disable variable expansion in sh.
Upvotes: 5