Your ad here would be seen by 100,000 unique vistors every month Haxx ad

Shopping cart software, Online file storage, Online photo storage, Hosted shopping cart, Contact management software, Email marketing software, Project management software, Issue tracking software, Online notepad, Web publishing software

curl's project page on

cURL > libcurl > C Interface Overview

Using The libcurl C Interface

There's the tutorial to start with, read the tutorial to get a general in-depth grip of what libcurl programming is all about.

There are some example C source codes you can check out. They're not all-covering or even very extensive, but they might serve as a source of inspiration to start hacking.

Windows developers using Microsoft Visual Studio, might enjoy:

Easy or Multi

The easy interface is a synchronous, efficient, quickly used and... yes, easy interface for file transfers. Numerous applications have been built using this.

The multi interface is the asynchronous brother in the family and it also offers multiple transfers using a single thread and more. Get a grip of how to work with it in the multi interface overview.

The Easy interface

When using libcurl you init your easy-session and get a handle, which you use as input to the following interface functions you use.

You continue by setting all the options you want in the upcoming transfer, most important among them is the URL itself. You might want to set some callbacks as well that will be called from the library when data is available etc.

When all is setup, you tell libcurl to perform the transfer. It will then do the entire operation and won't return until it is done or failed.

After the performance is made, you may get information about the transfer and then you cleanup the easy-session's handle and libcurl is entire off the hook!

See also the easy interface overview.


While the above functions are the main functions to use in the easy interface, there is a series of other helpful functions too including:

curl_version() returns a pointer to the libcurl version string
curl_getdate() converts a date string to time_t
curl_formadd() build multipart form-data posts
curl_formfree() free a previously built form POST
curl_slist_append() builds a linked list
curl_slist_free_all() frees a whole curl_slist as made with curl_slist_append()
curl_easy_escape() URL encodes a string
curl_easy_unescape() URL decodes a string

All man pages are included in every release archive, in three different formats: man page, HTML and pdf.

donate! Page updated April 20, 2009.
web site info

File upload with ASP.NET