We're trying to gather example source codes here, that show how to write
programs using the libcurl interface. Feel encouraged to submit yours!
PLEASE do not use the curl.haxx.se site as a test target for
your libcurl applications/experiments. Even if the examples sometimes use
that site as an example URL at some places, it doesn't mean that the URLs
work or that we expect you to actually torture our web site with your tests!
shows how to get a remote web page in only five libcurl function calls.
https.c gets a single HTTPS
page, while simplessl.c shows how to get a remote
https page and a set of various SSL-controlling options.
get HTTP with headers separate
gets a web page and stores the response-headers in a separate file.
proves that getting a FTP file is just as simple.
uploads a local file to a remote FTP server. It also renames the file after
get a remote file in memory only
describes how you can use the callback system to fetch documents into a ram
buffer with no file writing necessary.
makes PUTs a local file to a HTTP server.
HTTP form POST
shows how to build a RFC1867-style form post and send it to a HTTP
shows that just getting files in a sequential manner will make it use
persistant connections if the remote server supports it.
multithreaded URL fetches
starts a number of threads and retrieves one URL in each thread. This requires
a working thread library.
URL fetch with GTK progress bar
uses GTK and the libcurl progress callback to show a GUI progress bar while
how you could write an fopen()-style emulation layer to easily make your
program read URLs instead of local files.
nonblocking multipart formpost
makes a multipart formpost using the multi interface, which makes it a
how you can use the debug callback to get a full trace of all protocol data
being sent/received (and more).
shows how to use libxml to parse HTML retrieved with libcurl.
to set a custom callback to deal with an OpenSSL SSL_CTX * at SSL handshake
Doing SOAP with libcurl
SOAP example by vivtek.com
You'll also find these examples in the distribution archive, in the