在安装了curl的窗口cmd上运行时卷曲不起作用,但是同样的命令适用于git bash

时间:2017-04-25 11:36:23

标签: web-services curl post odata

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

1 个答案:

答案 0 :(得分:2)

用双引号替换您的单引号。 Windows cmd不适用于单个。例如:

curl -v -X POST "ipaddress" -H "Content-Type: application/octet-stream" -k --data-binary "@Test.png" -H "Authorization: token"