curl tricks
Basics
Send multi-line message by json
name="foo"
message="$@"
message="${message//$'\r'/}"
message="${message//$'\n'/\\n}"
json="{'message':'${message}','name':'$name'}"
json=$(echo "$json" | tr "'" '"')
curl -s -X POST -H "Content-Type: application/json" "$URL" -d "$json"