Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cygwin - curl: (3) Port number ended with '"' error

Tags:

curl

https

cygwin

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 '"'
like image 982
juniorbansal Avatar asked Oct 31 '17 03:10

juniorbansal


1 Answers

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
like image 160
Daniel Stenberg Avatar answered Nov 16 '22 13:11

Daniel Stenberg