Jump to content

CURL: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
neutral example
SimsimTee (talk | contribs)
→‎External links: Edited curl vs. wget link to point to a more thorough comparison (different tools) on the same site.
Line 113: Line 113:
* [http://curl.haxx.se/docs/httpscripting.html Scripting HTTP requests using cURL]
* [http://curl.haxx.se/docs/httpscripting.html Scripting HTTP requests using cURL]
* [http://www.wagerank.com/2007/how-to-submit-forms-with-php/ Submitting forms with cURL and PHP]
* [http://www.wagerank.com/2007/how-to-submit-forms-with-php/ Submitting forms with cURL and PHP]
* [http://daniel.haxx.se/docs/curl-vs-wget.html curl vs wget comparison]
* [http://curl.haxx.se/docs/comparison-table.html cURL vs other open source download tools]


[[Category:Free web crawlers]]
[[Category:Free web crawlers]]

Revision as of 11:14, 12 October 2009

cURL
Stable release
7.19.6 / August 12, 2009 (2009-08-12)
Repository
Written inC
Operating systemCross-platform
TypeFTP client / HTTP client
LicenseFree Software: MIT/X derivate license
Websitehttp://curl.haxx.se/

In computing, cURL functions as a command-line tool for transferring files with URL syntax. Daniel Stenberg started writing cURL in 1997, as a way to transfer files more programmatically via protocols such as http, ftp, gopher, sftp, ftps, scp, tftp, and many more (13 in total), via a command-line interface. cURL supports a large number of data-transfer protocols (listed below). Distributed under the MIT License, cURL is free software.

Most cURL use involves automating unattended file-transfers or sequences of operations. For example, it is a good tool for simulating a user's actions at a web browser.

Users may incorporate libcurl, the corresponding library/API into their programs; cURL acts as a stand-alone wrapper to the libcurl library. libcurl provides URL-based transfer capabilities to numerous applications ( open-source as well as proprietary).

Bindings in more than 30 languages are available for libcurl.

Examples

Basic use of cURL involves simply typing curl at the command line, followed by the URL of the output to retrieve.

To retrieve the example.com homepage, type:

curl www.example.com

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.

cURL can write the output it retrieves to a file with the -o flag, thus:

curl -o example.html www.example.com

This will store the source code for www.example.com into a file named example.html. While retrieving output, cURL will display a progress-bar showing how much of the output has downloaded. Note however that cURL does not show a progress bar when preparing to display the output in the terminal window, since a progress-bar might interfere with the display of the output.

To download output to a file that has the same name as on the system it originates from, use the -O flag.

curl -O (URL)

Supported protocols

  • FTPS
  • HTTP
  • HTTPS
  • TFTP
  • SCP
  • SFTP
  • Telnet
  • DICT
  • FILE
  • LDAP
  • LDAPS
  • Additional format support includes (among many other features):

    Daniel Stenberg wrote cURL, with contributions from more than 600 named helpers; notable contributors include Dan Fandrich and Yang Tse. A THANKS file in the distribution names all contributors, great and small.

    The copyright of cURL belongs to Daniel Stenberg.

    See also