I’m using cURL to upload file Box using this guide: https://developer.box.com/v2.0/reference#upload-a-file
There's a lot of cURL guides and posts for unix, but I couldn't find any for Windows how to do that. I'm using Windows command line, and my command is the following:
curl -X POST --header "Authorization: Bearer ACCESS_TOKEN" --header "Content-type: application/json" "https://upload.box.com/api/2.0/files/content" -F [email protected] -F attributes="{\"name\":\"test.txt\",\"parent\":{\"id\":\"0\"}}"
And I'm getting the following response:
Warning: garbage at end of field specification: ,"parent":{"id":"0"}}
The problem is caused by the fact that cURL treats comma as file separator so it ends processing my JSON in a place where comma appears. I tried a lot of combinations but I can't handle this. I guess that may be a trick with escaping characters or maybe something other...