json中需要包含变量 : 一: now=$(date +"%m-%d-%Y")curl -X POST -H "Content-Type: application/json" / --data
json中需要包含变量 :
一:
now=$(date +"%m-%d-%Y")curl -X POST -H "Content-Type: application/json" / --data '{ "color":"red", "message":"Build failed '"$now"'", "message_format":"text" }' / https://api.hipchat.com/v2/room/<room>/notification?auth_token=<token>
二:
now=$(date +"%m-%d-%Y")curl -X POST -H "Content-Type: application/json" / --data "{ /"color/":/"red/", /"message/":/"Build failed $now/", /"message_format/":/"text/" }" / https://api.hipchat.com/v2/room/<room>/notification?auth_token=<token>