curl -v -X POST "ipaddress" -H 'Content-Type: application/octet-stream' -k --data-binary '@Test.png' -H 'Authorization: token'
在git-bash上运行命令时,它会成功运行
但是当在安装了curl的窗口命令行上运行时,同一命令失败并显示以下错误:
upload completely sent off: 14 out of 14 b
HTTP/1.1 400 Bad Request
X-Content-Type-Options: nosniff
答案 0 :(得分:2)
用双引号替换您的单引号。 Windows cmd不适用于单个。例如:
curl -v -X POST "ipaddress" -H "Content-Type: application/octet-stream" -k --data-binary "@Test.png" -H "Authorization: token"