有没有办法在Windows中安装cURL,以便从命令提示符运行cURL命令?


当前回答

自2018年初以来,Windows 10内部构建17063 curl可在cmd和powershell中使用。

其他回答

我可能有点晚了,但我能够解决我的卷曲在cmd windows 10的问题。

我从下面的视频教程https://www.youtube.com/watch?v=qlTVMuONazs得到了帮助

下面是一些解释

第一步:登录https://curl.haxx.se/download.html

第二步:搜寻"Win64 -通用",下载"Win64 x86_647zip " by "Darren Owen"

步骤3:解压下载文件并安装证书“ca-bundle. zip”。Crt“不要触摸curl.exe”

第四步:在windows中进入“控制面板”->“系统”->“高级系统设置” " 步骤5:单击Envirnoment变量

步骤6:在系统变量中单击“Path”,并粘贴文件夹的路径,在我的例子中,它是“C:\curl\curl_7_53_1_openssl_nghttp2_x64”

这样就做完了。

不要忘记重新启动你的系统一次

访问下载页面https://curl.haxx.se/download.html -这是不可思议的 在列表中选择您的系统 别忘了SSL支持,现在很明显了,比如https 将curl.exe和.crt解压到C:\Windows\System32目录下 重启cmd 享受>卷曲https://api.stackexchange.com

p.s.如果您想要另一个文件夹存储可执行文件,请检查您的路径> echo %PATH%

我可以使用这个网站轻松地下载并在我的Windows机器上安装curl。总共花了30秒。我使用Windows 7 (w/ Admin特权),所以我下载了curl-7.37.0-win64。Msi来自http://curl.haxx.se/download.html。

此外,不要忘记在安装curl后重新启动控制台/终端,否则您将得到相同的错误消息。

如果您下载它,它应该工作得很好 ——http://curl.haxx.se/dlwiz/?type=bin&os=Win64&flav=MinGW64——FOR 64BIT Win7/XP或from http://curl.haxx.se/dlwiz/?type=bin&os=Win32&flav=-&ver=2000%2FXP——FOR 32BIT Win7/XP只需将文件解压到c:/Windows并从cmd中运行

C:\Users\WaQas>curl -v google.com
* About to connect() to google.com port 80 (#0)
*   Trying 173.194.35.105...
* connected
* Connected to google.com (173.194.35.105) port 80 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.28.1
> Host: google.com
> Accept: */*
>
* HTTP 1.0, assume close after body
< HTTP/1.0 301 Moved Permanently
< Location: http://www.google.com/
< Content-Type: text/html; charset=UTF-8
< Date: Tue, 05 Feb 2013 00:50:57 GMT
< Expires: Thu, 07 Mar 2013 00:50:57 GMT
< Cache-Control: public, max-age=2592000
< Server: gws
< Content-Length: 219
< X-XSS-Protection: 1; mode=block
< X-Frame-Options: SAMEORIGIN
< X-Cache: MISS from LHR-CacheMARA3
< X-Cache-Lookup: HIT from LHR-CacheMARA3:64003
< Connection: close
<
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>301 Moved</TITLE></HEAD><BODY>
<H1>301 Moved</H1>
The document has moved
<A HREF="http://www.google.com/">here</A>.
</BODY></HTML>
* Closing connection #0

更新:Curl现在包含在Windows中,不需要通过PowerShell运行它。

首先需要下载cURL可执行文件。对于Windows 64位,从这里下载,对于Windows 32位,从这里下载 之后,将curl.exe文件保存在C:驱动器上。

要使用它,只需打开命令提示符并输入:

C:\curl http://someurl.com