在64位Windows上运行cURL [英] Running cURL on 64 bit Windows
问题描述
我是cURL的新手,只是安装它,但它似乎只做感觉像。我使用的是我从这里获得的64位版本: http://curl.haxx.se /latest.cgi?curl=win64-ssl-sspi 与安装说明我在这里找到: 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 -dhello worldhttp:// localhost:3000
它告诉我Invoke-WebRequest:参数不能被处理,因为参数名'd'是不明确的。可能的匹配包括:-DisableKeepAlive -Debug。
获取帮助我键入
curl -h或curl --help
pre>
给我Invoke-WebRequest:缺少参数'Headers'的参数,指定一个类型为System.Collections.IDictionary的参数, / p>
正如我所说,我是一个cURL新手,但它似乎很奇怪,它可以得到请求,没有别的。任何想法我做错了什么?
Windows 7 64位
Powershell版本4解决方案您的问题是您没有使用安装的
Curl
,但是一个CmdLet名为Invoke-WebRequest
。
只要执行:
item别名:curl
再次测试您的curl,然后将其存储在您的个人资料中。
解释是它在
Invoke-WebRequest
中存在一个本机别名,它是一个CmdLet,应该传递种类的 curl服务。I'm new to cURL, just got it installed but it seems to only do what it feels like. I'm using the 64 bit version I got from here: http://curl.haxx.se/latest.cgi?curl=win64-ssl-sspi with installation instructions I found here: http://guides.instructure.com/m/4214/l/83393-how-do-i-install-and-use-curl-on-a-windows-machine. Opening a new Powershell window I'm able to use a simple GET request like so:
curl http://localhost:3000
but if I run a POST
curl -d "hello world" http://localhost:3000
it tells me "Invoke-WebRequest : Parameter cannot be processed because the parameter name 'd' is ambiguous. Possible matches include: -DisableKeepAlive -Debug."
Trying to get help I type
curl -h or curl --help
gives me "Invoke-WebRequest : Missing an argument for parameter 'Headers'. Specify a parameter of type 'System.Collections.IDictionary' and try again."
As I mentioned, I'm a cURL newbie but it seems strange that it can do get requests but nothing else. Any ideas what I'm doing wrong?
Windows 7 64 bit Powershell version 4
解决方案Your problem is that your are not using the
Curl
you installed but a CmdLet calledInvoke-WebRequest
.Just execute :
Remove-item alias:curl
And test your curl again, then store it in your profile.
The explanation is that it exists a native alias to the
Invoke-WebRequest
which is a CmdLet that is supposed to deliver a kind of curl service.这篇关于在64位Windows上运行cURL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!