在64位Windows上运行cURL

我是cURL的新手,只是安装了它,但似乎只做它的感觉。 我使用的是我从这里得到的64位版本: http : //curl.haxx.se/latest.cgi?curl=win64-ssl-sspi安装说明,我在这里find: http : //guides.instructure.com / m / 4214 / l / 83393-how-do-i-install-and-use-curl-on-a-windows-machine 。 打开一个新的Powershell窗口我可以使用一个简单的GET请求,如下所示:

curl http://localhost:3000 

但如果我运行一个POST

 curl -d "hello world" http://localhost:3000 

它告诉我“Invoke-WebRequest:Parameter无法处理,因为参数名称'd'不明确,可能的匹配包括:-DisableKeepAlive -Debug。

试图获得帮助,我键入

 curl -h or curl --help 

给我“Invoke-WebRequest:缺less参数”Headers“的参数。指定一个types为”System.Collections.IDictionary“的参数,然后重试。

正如我所说,我是一个curl新手,但似乎很奇怪,它可以做请求,但没有别的。 任何想法我做错了什么?

Windows 7 64位Powershell版本4

你的问题是你没有使用你安装的Curl ,而是一个叫做Invoke-WebRequest的CmdLet。

只要执行:

 Remove-item alias:curl 

再次测试你的卷曲,然后将其存储在你的个人资料中。

其解释是,它存在一个本机别名, Invoke-WebRequest是一个CmdLet,它应该提供一种 curl服务。