Text inside single quotes is treated as literals:
--data-raw '{ "token": "abcdjbdifusfus", "title": "$matchteams | $matchtime", "msg": "hello all", "channel": "1021890237204529235" }'
(The double quotes surrounding your variables are also treated as literals.) In this case you need either to come out of the single quotes so that the variables will get parsed and expanded by the shell, or enclose the entire string in double quotes, escaping literal double quote marks appropriately:
# Swapping between single quote strings and double quote strings --data-raw '{ "token": "abcdjbdifusfus", "title": "'"$matchteams | $matchtime"'", "msg": "hello all", "channel": "1021890237204529235" }' # Enclosing the entire string in double quotes with escaping as necessary --data-raw "{ \"token\": \"abcdjbdifusfus\", \"title\": \"$matchteams | $matchtime\", \"msg\": \"hello all\", \"channel\": \"1021890237204529235\" }"
Remember that "abc"'def'
is expanded by the shell as abcdef
so it's quite acceptable to swap quoting style mid-string. On balance I would tend to use the first style.
'
and as exactly the reason to do that, now$
expressions aren't expanded"; but in general, it helps actually explaining what the problem is, i.e., saying what happens instead of what you expected."{ \"token\": \"abcdjbdifusfus\", \"title\": \"$matchteams | $matchtime\", \"msg\": \"hello all\", \"channel\": \"1021890237204529235\" }"