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


当前回答

如果你使用Chocolatey包管理器,你可以通过从命令行或PowerShell运行这个命令来安装cURL:

choco install curl

其他回答

如果你使用Chocolatey包管理器,你可以通过从命令行或PowerShell运行这个命令来安装cURL:

choco install curl

在窗口中创建批处理文件,并在窗口中享受cURL:)

@echo off
echo You are about to use windows cURL, Enter your url after curl command below:
set /p input="curl "
cls
echo %input%
powershell -Command "(new-object net.webclient).DownloadString('%input%')"
pause

如果您不喜欢Cygwin,您可以使用本地Windows构建。有些在这里:curl下载向导。

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

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

安装Git for windows 然后使用git bash运行curl命令。