gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-04 12:51:37 25 4
gpt4 key购买 nike

我在Windows 7专业版cygwin中使用cURL命令将文件上传到目标位置,并且看到端口号以消息结尾。我的错误在哪里?

$ 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 '"'

最佳答案

您要发布的数据(JSON字符串)前面没有-F-因此curl将其视为URL并将其视为一个URL,并且无法将其解析为一个URL-因此,错误消息(且-X POST不应为那里)。我假设您希望这是一个多部分的表单?

经过编辑的命令行如下所示:

$ 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

关于curl - cygwin- curl : (3) Port number ended with '"' error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47027522/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com