如何在curl的请求 header 中设置环境变量
curl --location --request POST 'test.example.com' \
--header 'Content-Type: application/json' \
--header 'access_token: "${SOME_ENV_TOKEN}"' \
--header 'Authorization: Basic Og=='
不工作。
最佳答案
使用 --header "access_token:\"${SOME_ENV_TOKEN}\""
'
引号禁用 sh 中的变量扩展。
关于bash - 如何在curl的请求 header 中设置环境变量?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67924837/