cURL

本页使用了标题或全文手工转换
维基百科,自由的百科全书

cURL
curl -O的输出结果
curl -O的输出结果
原作者丹尼尔·斯坦伯格
首次发布1997[1]
当前版本
  • 8.7.1 (2024年3月27日;穩定版本)[2]
編輯維基數據鏈接
源代码库 編輯維基數據鏈接
编程语言C
操作系统跨平台
类型FTP / HTTP
许可协议自由软件:MIT/X derivate license
网站curl.se

cURL是一个开源项目,主要的产品是curl(命令行工具)和libcurl(C语言的API库),两者功能均是:基于网络协议,对指定URL进行网络传输。[3][4]

cURL涉及是任何网络协议传输,不涉及对具体数据的具体处理(如:html的渲染等)。

歷史

cURL最先於1997年釋出[5],當時的專案名稱是 httpget,之後改為 urlget [6]

libcurl

libcurl 是一个免费的客户端 URL 传输库,[7]支持 cookie、DICT、FTP、FTPS、Gopher、HTTP/1(亦支持 HTTP/2 和 HTTP/3)、HTTP POST、HTTP PUT、HTTP 代理隧道、HTTPS、IMAP、Kerberos、LDAP、MQTT、POP3、RTSP、RTMP、SCP、SMTP 和 SMB。该库支持文件 URI 方案、SFTP、Telnet、TFTP、文件传输恢复、FTP 上传、基于 HTTP 表单的上传、HTTPS 证书、LDAPS、代理和用户增强密码身份验证。

libcurl 库支持 GnuTLS、mbed TLS、NSS、IBM i 上的 gskit、Windows 上的 SChannel、macOS 和 iOS 上的 Secure Transport、OpenSSL、Boringssl、libressl、AmiSSL、wolfSSL、BearSSL 和 rustls 的 SSL/TLS。[8]

curl

curl 支持的通訊協定有 DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, SMB, SBMS, SMTP, SMTPS, TELNET 和TFTP。[9]

例子

简单模式:

$ curl http://example.com

详细(verbose)模式:

$ curl --verbose http://example.com
$ curl -v http://example.com

下载(output):

$ curl --output output.html http://example.com/
$ curl -o output.html http://example.com/

重定向:(curl默认不会重定向

$ curl --location output.html http://example.com/
$ curl -L output.html http://example.com/

外部链接

参考资料

  1. ^ cURL History Page. [2012-05-01]. (原始内容存档于2012-04-23). 
  2. ^ curl 8.7.0 and 8.7.1 | daniel.haxx.se. 2024年3月27日 [2024年3月27日] (英語). 
  3. ^ What does curl do?. ec.haxx.se. [2020-01-27]. (原始内容存档于2020-01-27). 
  4. ^ cURL必知必会-图书-图灵社区. www.ituring.com.cn. [2020-01-27]. (原始内容存档于2018-09-28). 
  5. ^ cURL: docs/HISTORY.md | Fossies. fossies.org. [2019-09-29]. (原始内容存档于2019-09-29). 
  6. ^ Changelog. 2020-01-04 [2020-01-04]. (原始内容存档于2020-01-05) (英语). The first curl release. The tool was named urlget before this. And httpget before that. 
  7. ^ IBM Developer. developer.ibm.com. [2022-07-09]. (原始内容存档于2022-09-01). 
  8. ^ curl supports rustls | daniel.haxx.se. [2022-07-09]. (原始内容存档于2022-08-09) (美国英语). 
  9. ^ Using curl. ec.haxx.se. [2020-01-27]. (原始内容存档于2020-01-27).