I am using cURL command in cygwin, Windows 7 Professional, to upload a file into a destination and I am seeing port number ended with message. Where is my mistake?
$ curl -k -u username:'password' --cacert D:/'My Data'/Desktop/cacert.pem -X POST "jsonInputParameters={\"parentID\":\"FAECDB25A7775B98062FEF15F6C3FF17C1177A968060\"}" -F "primaryFile=@C:/Users/user/AppData/Local/Temp/2704092483770369841.pdf" https://host/documents/api/1.1/files/data
curl: (3) Port number ended with '"'
The data you want to post, the JSON string, lacks a -F
in front of it - so curl treats and considers it to be a URL and it fails to parse it as one - hence the error message (and the -X POST
shouldn't be there). I assume you want this to be a multipart formpost?
An edited command line would then look like:
$ curl -k -u username:'password' --cacert D:/'My Data'/Desktop/cacert.pem -F "jsonInputParameters={\"parentID\":\"FAECDB25A7775B98062FEF15F6C3FF17C1177A968060\"}" -F "primaryFile=@C:/Users/user/AppData/Local/Temp/2704092483770369841.pdf" https://host/documents/api/1.1/files/data
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With