次のページを参考にしました。
SlackのIncoming Webhooksを使い倒す
Sending messages using Incoming Webhooks
Slack の endpoint は作成済とします。
curl で POST
go_curl_aa.sh
URL="https://hooks.slack.com/services/*****"
#
curl -X POST --data-urlencode "payload={\"text\": \"TEST Jul/07/2023\" }" $URL
go_curl_bb.sh
URL="https://hooks.slack.com/services/*****"
#
curl -X POST -H 'Content-type: application/json' --data '{"text":"Hello, World!"}' $URL
go_curl_cc.sh
URL="https://hooks.slack.com/services/*****"
#
curl -X POST -d@in01.json $URL
http で POST
go_http.sh
URL="https://hooks.slack.com/services/*****"
#
http $URL < in01.json
in01.json
{"text":"Hello, World! Jul/07/2023 こんにちは"}