jenkins 将当前项目的环境变量 作为post的请求中的参数
jenkins中 调用 curl 发送post命令时,使用当前项目的环境变量作为post请求的参数,
要用" ’ ’ "将环境变量括起来。
写法如下
“mail_pass”:" ‘${mail_pass}’ "
要用’ '将环境变量括起来。
curl -X POST http://172.26.12.87:9090/send/email -H 'Content-Type: application/json' -H
'cache-control: no-cache' -d '{"mail_sender":"'${mail_sender}'","mail_receiver":"'${mail_receiver}'","mail_pass":"'${mail_pass}'"}'