I am trying to update a file on my GitHub repo using curl. Unfortunately it keeps giving me the same error message of "Problems parsing JSON". The command that I am using is:
curl -i -X PUT -H "Authorization: token <token>" -H "Content-Type: application/json" -d '{\"message\": \"<message>\", \"committer\": { \"name\": \"<name>\", \"email\": \"<email_address>\" }, \"content\": \"<contents_of_file_in_base64>\", \"sha\": \"<SHA_hash>\"}' https://api.github.com/repos/<user>/<repo>/contents/<data_path>
This command is being sent via node js. Anyone have any ideas what I am doing wrong?
So I solved it. I had to put 2 double quotes around all the property names and the values. As in {""valueName1"": ""value1"", ""valueName2"": ""value2""}.