我在让cURL在Windows上运行时遇到了麻烦。
我已经从这里下载了一个cURL zip文件,但它似乎包含源代码,而不是可执行文件。
我需要编译cURL来运行它吗?如果是,那么我该怎么做?
我在哪里可以找到cURL的.exe下载?
我已经寻找了关于安装cURL的文档,但是几乎找不到。
我在让cURL在Windows上运行时遇到了麻烦。
我已经从这里下载了一个cURL zip文件,但它似乎包含源代码,而不是可执行文件。
我需要编译cURL来运行它吗?如果是,那么我该怎么做?
我在哪里可以找到cURL的.exe下载?
我已经寻找了关于安装cURL的文档,但是几乎找不到。
当前回答
我遵循了@theglauber的回答(最受欢迎的回答),但在Windows 10终端/ PowerShell上,环境设置不生效。
我不得不CD到GIT的位置,也使用。\ like如下:
PS C:\Program Files\Git\mingw64\bin> .\curl -X POST https://6sl8yohih.execute-api.us-west-1.amazonaws.com/dev/hello
不过,在常规命令提示符上我没有遇到任何问题。
只是把这篇文章作为对那些可能和我一样挣扎的人的回答。
其他回答
只需下载curl并解压压缩文件。你会得到“curl.exe”文件。打开一个CMD Shell,将文件curl.exe拖到CMD Shell中,现在您可以使用curl了。
我在Windows上使用curl时遇到了很多问题。最后我使用了Cygwin,它默认包含curl。
从Windows 10版本1803开始(以及更早的内部版本17063),您不再安装curl。Windows包含在C:\Windows\System32\中的本机curl.exe(和tar.exe),您可以从常规CMD中直接访问。
C:\Users\vonc>C:\Windows\System32\curl.exe --version
curl 7.55.1 (Windows) libcurl/7.55.1 WinSSL
Release-Date: [unreleased]
Protocols: dict file ftp ftps http https imap imaps pop3 pop3s smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile SSPI Kerberos SPNEGO NTLM SSL
C:\Users\vonc>C:\Windows\System32\tar.exe --version
bsdtar 3.3.2 - libarchive 3.3.2 zlib/1.2.5.f-ipp
请参见初始公告和发布公告。
按照下载向导下载
按照屏幕依次选择包类型(curl可执行文件)、操作系统(Win64)、类型(Generic)、CPU (x86_64)和下载链接。
解压下载并找到curl.exe(我在src文件夹中找到它,对于不同的OS/风味,可能会在bin文件夹中找到它)
要使其从命令行可用,请将可执行路径添加到系统路径(在Windows中将目录添加到path环境变量中)。
喜欢卷发。
Download curl zip Extract the contents (if you have downloaded the correct version you should find curl.exe) Place curl.exe in a folder where you keep your software (e.g. D:\software\curl\curl.exe) To run curl from the command line a) Right-hand-click on "My Computer" icon b) Select Properties c) Click 'Advanced system settings' link d) Go to tab [Advanced] - 'Environment Variables' button e) Under System variable select 'Path' and Edit button f) Add a semicolon followed by the path to where you placed your curl.exe (e.g. ;D:\software\curl)
现在你可以在命令行中输入:
curl www.google.com