Original author(s) | Daniel Stenberg[1] |
---|---|
Developer(s) | Contributors to the cURL project |
Initial release | 1997; 22 years ago[2] |
Stable release | 7.65.1 (5 June 2019; 3 months ago[3])[±] |
Repository | |
Written in | C |
Operating system | AIX, AmigaOS, BeOS, Chrome NaCl, DOS, DragonFly BSD, FreeBSD, GNU-Darwin, HPUX, Haiku, Hurd, IRIX, Linux, macOS, MiNT, Midnight BSD, Minix, NetBSD, NetWare, Nexenta, OS/2, Open Server, OpenBSD, Plan9, QNX, RISC OS, Solaris, Syllable, Tru64 UNIX, UnixWare, VMS, Microsoft Windows, z/OS |
Platform | IA-32, x64 |
Type | FTP client / HTTP client |
License | Free Software: MIT/X derivate license |
Website | curl.haxx.se |
cURL (pronounced 'curl'[4]) is a computer software project providing a library (libcurl) and command-line tool (curl) for transferring data using various protocols. It was first released in 1997. The name stands for 'Client URL'.[5] The original author and lead developer is the Swedish developer Daniel Stenberg.[1]
libcurl[edit]
libcurl is a free client-side URL transfer library,[6] supporting cookies, DICT, FTP, FTPS, Gopher, HTTP/1[7] (with HTTP/2 support), HTTP POST, HTTP PUT, HTTP proxy tunneling, HTTPS, IMAP, Kerberos, LDAP, POP3, RTSP, SCP, and SMTP. The library supports the file URI scheme, SFTP, Telnet, TFTP, file transfer resume, FTP uploading, HTTP form-based upload, HTTPS certificates, LDAPS, proxies, and user-plus-password authentication.
Alternatives to cURL for Mac with any license Wget GNU Wget is a free software package for retrieving files using HTTP(S) and FTP, the most widely-used Internet protocols. In this video we will cover the basics of cURL which is a tool/command for transferring data and making requests. CURL is a tool that every web developer should know at least the basics of.
The libcurl library is portable. It builds and works identically on many platforms, including AIX, AmigaOS, Android, BeOS, BlackBerry Tablet OS and BlackBerry 10,[8]OpenVMS, Darwin, DOS, FreeBSD, HP-UX, HURD, iOS, IRIX, Linux, macOS, NetBSD, NetWare, OpenBSD, OS/2, QNX Neutrino, RISC OS, Solaris, Symbian, Tru64, Ultrix, UnixWare, and Microsoft Windows.[9]
The libcurl library is free, thread-safe and IPv6 compatible. Bindings are available for more than 40 languages, including C/C++, Java, PHP and Python.
The libcurl library can support axTLS,[10]GnuTLS, mbed TLS, NSS, QSOSSL on IBM i, SChannel on Windows, Secure Transport on macOS and iOS, SSL/TLS through OpenSSL, and wolfSSL.
cURL[edit]
cURL is a command-line tool for getting or sending data including files using URL syntax.
Since cURL uses libcurl, it supports a range of common network protocols, currently including HTTP,[7] HTTPS, FTP, FTPS, SCP, SFTP, TFTP, LDAP, DAP, DICT, TELNET, FILE, IMAP, POP3, SMTP and RTSP (the last four only in versions newer than 7.20.0 or 9 February 2010).
cURL supports HTTPS and performs SSL certificate verification by default when a secure protocol is specified such as HTTPS. When cURL connects to a remote server via HTTPS, it will obtain the remote server certificate, then check against its CA certificate store the validity of the remote server to ensure the remote server is the one it claims to be. Some cURL packages are bundled with CA certificate store file. There are several options to specify a CA certificate such as --cacert and --capath. The --cacert option can be used to specify the location of the CA certificate store file. In the Windows platform, if a CA certificate file is not specified, cURL will look for a CA certificate file name “curl-ca-bundle.crt” in the following order:
- Directory where the cURL program is located.
- Current working directory.
- Windows system directory.
- Windows directory.
- Directories specified in the %PATH% environment variables.[11]
cURL will return an error message if the remote server is using a self-signed certificate, or if the remote server certificate is not signed by a CA listed in the CA cert file. -k or --insecure option can be used to skip certificate verification. Alternatively, if the remote server is trusted, the remote server CA certificate can be added to the CA certificate store file.
Examples[edit]
Basic use of cURL involves simply typing curl at the command line, followed by the URL of the output to retrieve:
cURL defaults to displaying the output it retrieves to the standard output specified on the system (usually the terminal window). So running the command above would, on most systems, display the www.example.com source-code in the terminal window. The -o flag can be used to store the output in a file instead:
More options that change the tool's behavior are available.
See also[edit]
Itool For Mac
- curl-loader – an open-source testing tool based on cURL
- libwww – an early library that comes with a command line interface
- PowerShell – the iwr (Invoke-WebRequest) Windows PowerShell had functionality akin to curl
- Web crawler – an internet bot that can crawl the web
- Wget – similar command-line tool with no associated library but capable of recursive downloading
References[edit]
- ^ abStenberg, Daniel (20 March 2015). 'curl, 17 years old today'. daniel.haxx.se. Retrieved 20 March 2015.
- ^'History of curl - How curl Became Like This'. curl. Retrieved November 17, 2016.
Daniel simply adopted an existing command-line open-source tool, httpget, that Brazilian Rafael Sagula had written and recently release version 0.1 of. After a few minor adjustments, it did just what he needed. […] HttpGet 1.0 was released on April 8th 1997 with brand new HTTP proxy support.
- ^'curl - Changes'. cURL. Retrieved 6 June 2019.
- ^cURL - Frequently Asked Questions
- ^Stenberg, Daniel. 'Origin of the name'. curl.haxx.se/. Retrieved 2018-04-25.
- ^Jones, M. Tim (8 September 2009). 'Conversing through the Internet with cURL and libcurl - Using libcurl with C and Python'. IBM Developerworks. Archived from the original on 14 April 2015. Retrieved 12 September 2018.Cite uses deprecated parameter
|dead-url=
(help) - ^ abStenberg, Daniel (5 August 2019). 'http09: disable HTTP/0.9 by default in both tool and library'. GitHub. Archived from the original(html) on 5 August 2019. Retrieved 5 August 2019.
As the plan has been laid out in DEPRECATED. Update docs accordingly and verify in test 1174.
- ^Open Source Components for the Native SDK for BlackBerry Tablet OS
- ^https://techcommunity.microsoft.com/t5/Containers/Tar-and-Curl-Come-to-Windows/ba-p/382409
- ^axTLS
- ^cURL - Protocol docs - SSL Certificate Verification
External links[edit]
Wikibooks has a book on the topic of: Guide to Windows Commands |
How can I do an HTTP GET from a Un*x shell script on a stock OS X system? (installing third-party software is not an option, for this has to run on a lot of different systems which I don't have control on).
For example if I start the Mercurial server locally doing a hg serve:
And then, from a Linux that has the wget command I do a wget:
And on the terminal in which I launched the 'hg serve' command, I can indeed see that an HTTP GET made its way:
So on Linux one way to do an HTTP GET from a shell script is to use wget (if that command is installed of course).
What other ways are there to do the equivalent of a wget? I'm looking, in particular, for something that would work on stock OS X installs.
SyntaxT3rr0rSyntaxT3rr0r10 Answers
I'm going to have to say curl http://127.0.0.1:8000 -o outfile
brew install wget
Homebrew is a package manager for OSX analogous to yum, apt-get, choco, emerge, etc. Be aware that you will also need to install Xcode and the Command Line Tools. Virtually anyone who uses the command line in OSX will want to install these things anyway.
If you can't or don't want to use homebrew, you could also:
Install wget manually:
Or, use a bash alias:
Eric HartfordEric HartfordCurl has a mode that is almost equivalent to the default wget.
This works just like
And, if you like, you can add this to your .bashrc:
It's not 100% compatible, but it works for the most common wget usage (IMO)
1) on your mac type
2) paste the following in
3) close then make it executable
That's it.
Zizouz212Here's the Mac OS X equivalent of Linux's wget.
For Linux, for instance Ubuntu on an AWS instance, use:
On a Mac, i.e. for local development, use this:
The -o parameter is required on a Mac for output into a file instead of on screen. Specify a different target name for renaming the downloaded file.
Use capital -O for renaming with wget. Lowercase -o will specify output file for transfer log.
Oliver SchafeldOliver SchafeldInstead of going with equivalent, you can try 'brew install wget' and use wget.
You need to have brew installed in your mac.
You can either build wget on the mac machine or use MacPorts to install it directly.
This would work like a charm, also you can update to the latest version as soon as it's available. Port is much more stable than brew, although has a lot less number of formula and ports.
You can install MacPorts from https://www.macports.org/install.php
you can download the .pkg
file and install it.
Cut Tool For Mac
You could use curl
instead. It is installed by default into /usr/bin
.
Mac Curl Download
James SumnersFor those looking for a quick wget install on Mac, check out Quentin Stafford-Fraser's precompiled binary here, which has been around for over a decade:
https://statusq.org/archives/2008/07/30/1954/
MD5 for 2008 wget.zip: 24a35d499704eecedd09e0dd52175582
MD5 for 2005 wget.zip: c7b48ec3ff929d9bd28ddb87e1a76ffb
No make/install/port/brew/curl junk. Just download, install, and run. Works with Mac OS X 10.3-10.12+.
protected by Community♦Nov 25 '15 at 5:12
Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?