0

I'm working with installr API. I'm trying to do the following curl request via a script :

curl -H "X-InstallrAppToken: mytoken"  https://www.installrapp.com/apps.json/ \
  -F 'qqfile=@'$APKPATH \
  -F 'releaseNotes=These are my release notes' \
  -F 'notify=true'

and it works perfectly. However, when I try to get my release notes from a file with a variable like this :

RELEASENOTES=`cat "release_notes/test.md"`
curl -H "X-InstallrAppToken: mytoken"  https://www.installrapp.com/apps.json/ \
  -F 'qqfile=@'$APKPATH \
  -F 'releaseNotes='$RELEASENOTES \
  -F 'notify=true' > /dev/null

it doesn't work at all, only the first word is sent. For the others, I have the error Could not resolve host: xxx.

I did a echo on these two curl request and the exact same thing is printed. is that the catcommand which return a specific format ?

1 Answer 1

1

Probably an issue with the quotes and spaces. You can use double-quotes around a variable to allow variable expansion in the shell.

RELEASENOTES=$(cat "release_notes/test.md")
curl -H "X-InstallrAppToken: mytoken"  https://www.installrapp.com/apps.json/ \
  -F "qqfile=@${APKPATH}" \
  -F "releaseNotes=${RELEASENOTES}" \
  -F 'notify=true' > /dev/null
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.