I have the following bash script
#!/bin/bash
body=$(cat << EOF
{
"CreatedBy": "$(hostname -f)",
"Id": "$(uuidgen)",
"Type": "TestAlertType",
"AlertCategory": "NonUrgent"
}
EOF
)
curl -H "Content-Type: application/json" -X POST -d $body https://dev.cloudapp.net/v1/
But I get invalid json error on post. What am i missing?
This worked
curl -H "Content-Type: application/json" -X POST -d "$body" https://dev.cloudapp.net/v1/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With