CURL
From Wikipedia, the free encyclopedia
- The correct title of this article is cURL. The initial letter is shown capitalized due to technical restrictions.
- For other uses, see Curl (disambiguation).
cURL is a command line tool for transferring files with URL syntax, supporting FTP, FTPS, HTTP, HTTPS, TFTP, Telnet, DICT, FILE and LDAP. cURL supports HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading, Kerberos, HTTP form based upload, proxies, cookies, user+password authentication (Basic, Digest, NTLM and Negotiate for HTTP and kerberos4 for FTP), file transfer resume, http proxy tunneling and many other features. cURL is open source/free software distributed under MIT License.
The main purpose and use for cURL the command line tool is to automate unattended file transfers or sequences of operations. It is for example a good tool for simulating a user's actions at a web browser.
Libcurl is the corresponding library/API that users may incorporate into their programs; cURL acts as a stand-alone wrapper to the libcurl library. libcurl is being used to provide URL transfer capabilities to numerous applications, Open Source as well as many commercial ones.
More than 30 different language bindings are available for libcurl.
[edit] Command-Line example
On a computer running Unix (or a Unix-like operating system such as Linux, or a somewhat Unix-like compatibility layer such as Cygwin), the following command downloads the HTML source for the article you are reading, to a file curl.html in the current directory:
$ curl -o curl.html http://en.wikipedia.org/wiki/CURL % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 15167 0 15167 0 0 25473 0 --:--:-- --:--:-- --:--:-- 99258KBps
For comparison, the equivalent procedure in a typical Web browser would be:
- Browse to the article.
- Select File | Save Page As...
- On the Save As dialog, navigate to the directory where you wish to save the page, and type a suitable filename in the File Name field.
Because the typical Web browser has a graphical user interface, it is difficult to automate with a script. The user would have to laboriously repeat the procedure for every file he or she wishes to download. The cURL command, on the other hand, is easy to automate with a script (for example, to download thousands of files from multiple Web sites), because it has a command line interface.