I am tearing my hair out on this. I am attempting the following:
curl -S https/api.bitbucket.org/2.0/repositories/etc/etc/pullrequests/comments \
-u username:pw
--request POST --header 'Content-Type: application/json' \
-d '{"content": {"text": "'"$logMsg"'"}}'
This, even with the -S throws back an ambiguous bad request. The $logMsg has a large number of special characters and newlines, an example of what it looks like may be:
"\n\n***HelloThere** <->:+/"
Note that whatever the variable is should be wrapped in double quotes. I have no idea what is going on with bash with how it's interpreting that variable because copying and pasting the string literal into postman works perfectly. Example:
--data-raw '{"content": { "raw": "\n\n***HelloThere**<->:+/"}}'
I have a feeling there is some string interpolation going on (IE turning \n into an actual newline) but I am unsure how to resolve.