Trouble with bash shell script, attempting to POST variable JSON data using cURL
问题 I'm having trouble with a bash shell script, attempting to POST variable JSON data using cURL. I'm running from a Mac. I can successfully post static data but I can't seem to figure out how to incorporate variables. I introduced <room> and <token> for the sake of these examples. This script works successfully: #!/bin/bash curl -X POST -H "Content-Type: application/json" --data '{ "color":"red", "message":"Build failed", "message_format":"text" }' https://api.hipchat.com/v2/room/<room>