I have a curl command that sends a string of text to the server and I've been trying to figure out how to either have the string of text come from a file or from a bash variable. The command looks like this:
curl -X POST -u "apikey:<apikey>"
--header "Content-Type: application/json"
--data '{"text": "<variable>"}'
"<url>"
I can't figure out how to get a variable in there. I've tried replacing with $variable and $(< file) but I don't know how to get those to spit out text without an echo and I can't echo in a curl.