cURL
用於使用 URL 語法傳輸資料的命令列工具與函式庫 / 維基百科,自由的 encyclopedia
cURL是一個開源項目,主要的產品是curl(命令行工具)和libcurl(C語言的API庫),兩者功能均是:基於網絡協議,對指定URL進行網絡傳輸。[4][5]
![]() | 此條目可參照英語維基百科相應條目來擴充。 |
![]() | |
![]() curl -O 的輸出結果 | |
原作者 | 丹尼爾·斯坦伯格 |
---|---|
首次發布 | 1997[1] |
當前版本 | ![]() |
源代碼庫 | ![]() |
編程語言 | C |
操作系統 | 跨平台 |
類型 | FTP / HTTP |
許可協議 | 自由軟件:MIT/X derivate license |
網站 | curl |
cURL涉及是任何網絡協議傳輸,不涉及對具體數據的具體處理(如:html的渲染等)。
歷史
cURL最先於1997年釋出[6],當時的專案名稱是 httpget,之後改為 urlget [7]。
libcurl
libcurl 是一個免費的客戶端 URL 傳輸庫,[8]支持 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。[9]
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。[10]
例子
簡單模式:
$ 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 --location output.html http://example.com/
$ curl -L output.html http://example.com/
外部連結
參考資料
- cURL History Page. [2012-05-01]. (原始內容存檔於2012-04-23).
- Release 8.8.0. 2024年5月22日 [2024年5月22日].
- 丹尼爾·斯坦伯格. curl 8.8.0. 2024年5月22日 [2024年5月24日] (英語). 引文格式1維護:未識別語文類型 (link)
- What does curl do?. ec.haxx.se. [2020-01-27]. (原始內容存檔於2020-01-27).
- cURL必知必会-图书-图灵社区. www.ituring.com.cn. [2020-01-27]. (原始內容存檔於2018-09-28).
- cURL: docs/HISTORY.md | Fossies. fossies.org. [2019-09-29]. (原始內容存檔於2019-09-29).
- IBM Developer. developer.ibm.com. [2022-07-09]. (原始內容存檔於2022-09-01).
- curl supports rustls | daniel.haxx.se. [2022-07-09]. (原始內容存檔於2022-08-09) (美國英語).
- Using curl. ec.haxx.se. [2020-01-27]. (原始內容存檔於2020-01-27).