Viktor Szakats 44872aefc2 http: add support to read and store the referrer header 3 years ago
..
.checksrc 2f72ad44fc checksrc: ban gmtime/localtime 3 years ago
.gitignore 77b2f702c4 examples: update .gitignore 3 years ago
10-at-a-time.c ac0a88fd25 copyright: fix year ranges 3 years ago
Makefile.am a93c647de8 examples/libtest: add .checksrc to dist 3 years ago
Makefile.example 4d2f800677 curl.se: new home 3 years ago
Makefile.inc 44872aefc2 http: add support to read and store the referrer header 3 years ago
Makefile.m32 2dfe3d7093 Makefile.m32: add support for libgsasl dependency 3 years ago
Makefile.netware 4d2f800677 curl.se: new home 3 years ago
README.md 4d2f800677 curl.se: new home 3 years ago
adddocsref.pl 4d2f800677 curl.se: new home 3 years ago
altsvc.c ac0a88fd25 copyright: fix year ranges 3 years ago
anyauthput.c f2ed79d8ee docs/examples: adjust prototypes for CURLOPT_READFUNCTION 3 years ago
cacertinmem.c 1451f4d2e1 examples: remove superfluous asterisk uses 3 years ago
certinfo.c ac0a88fd25 copyright: fix year ranges 3 years ago
chkspeed.c ac0a88fd25 copyright: fix year ranges 3 years ago
cookie_interface.c ac0a88fd25 copyright: fix year ranges 3 years ago
crawler.c 207a6cbb90 src: Remove C99 constructs to ensure C89 compliance 4 years ago
curlgtk.c 2855997a95 examples/curlgtk.c: fix the copyright year range 3 years ago
curlx.c 308c243db5 all: fix codespell errors 4 years ago
debug.c ac0a88fd25 copyright: fix year ranges 3 years ago
ephiperfifo.c 4d2f800677 curl.se: new home 3 years ago
evhiperfifo.c ac0a88fd25 copyright: fix year ranges 3 years ago
externalsocket.c ac0a88fd25 copyright: fix year ranges 3 years ago
fileupload.c ac0a88fd25 copyright: fix year ranges 3 years ago
fopen.c 0bc60d91de copyrights: fix copyright year range 4 years ago
ftp-wildcard.c ac0a88fd25 copyright: fix year ranges 3 years ago
ftpget.c ac0a88fd25 copyright: fix year ranges 3 years ago
ftpgetinfo.c ac0a88fd25 copyright: fix year ranges 3 years ago
ftpgetresp.c ac0a88fd25 copyright: fix year ranges 3 years ago
ftpsget.c ac0a88fd25 copyright: fix year ranges 3 years ago
ftpupload.c f2ed79d8ee docs/examples: adjust prototypes for CURLOPT_READFUNCTION 3 years ago
ftpuploadfrommem.c f2ed79d8ee docs/examples: adjust prototypes for CURLOPT_READFUNCTION 3 years ago
ftpuploadresume.c f2ed79d8ee docs/examples: adjust prototypes for CURLOPT_READFUNCTION 3 years ago
getinfo.c ac0a88fd25 copyright: fix year ranges 3 years ago
getinmemory.c ac0a88fd25 copyright: fix year ranges 3 years ago
getredirect.c ac0a88fd25 copyright: fix year ranges 3 years ago
ghiper.c ac0a88fd25 copyright: fix year ranges 3 years ago
hiperfifo.c ac0a88fd25 copyright: fix year ranges 3 years ago
href_extractor.c ac0a88fd25 copyright: fix year ranges 3 years ago
htmltidy.c ac0a88fd25 copyright: fix year ranges 3 years ago
htmltitle.cpp ac0a88fd25 copyright: fix year ranges 3 years ago
http-post.c ac0a88fd25 copyright: fix year ranges 3 years ago
http2-download.c 4d2f800677 curl.se: new home 3 years ago
http2-pushinmemory.c 0a5b8af777 examples: fix more empty expression statement has no effect 3 years ago
http2-serverpush.c 0a5b8af777 examples: fix more empty expression statement has no effect 3 years ago
http2-upload.c f2ed79d8ee docs/examples: adjust prototypes for CURLOPT_READFUNCTION 3 years ago
http3-present.c ac0a88fd25 copyright: fix year ranges 3 years ago
http3.c ac0a88fd25 copyright: fix year ranges 3 years ago
httpcustomheader.c ac0a88fd25 copyright: fix year ranges 3 years ago
httpput-postfields.c 71ec4e7d76 httpput-postfields.c: new example doing PUT with POSTFIELDS 3 years ago
httpput.c f2ed79d8ee docs/examples: adjust prototypes for CURLOPT_READFUNCTION 3 years ago
https.c ac0a88fd25 copyright: fix year ranges 3 years ago
imap-append.c f2ed79d8ee docs/examples: adjust prototypes for CURLOPT_READFUNCTION 3 years ago
imap-authzid.c ac0a88fd25 copyright: fix year ranges 3 years ago
imap-copy.c ac0a88fd25 copyright: fix year ranges 3 years ago
imap-create.c ac0a88fd25 copyright: fix year ranges 3 years ago
imap-delete.c ac0a88fd25 copyright: fix year ranges 3 years ago
imap-examine.c ac0a88fd25 copyright: fix year ranges 3 years ago
imap-fetch.c ac0a88fd25 copyright: fix year ranges 3 years ago
imap-list.c ac0a88fd25 copyright: fix year ranges 3 years ago
imap-lsub.c ac0a88fd25 copyright: fix year ranges 3 years ago
imap-multi.c ac0a88fd25 copyright: fix year ranges 3 years ago
imap-noop.c ac0a88fd25 copyright: fix year ranges 3 years ago
imap-search.c ac0a88fd25 copyright: fix year ranges 3 years ago
imap-ssl.c ac0a88fd25 copyright: fix year ranges 3 years ago
imap-store.c ac0a88fd25 copyright: fix year ranges 3 years ago
imap-tls.c ac0a88fd25 copyright: fix year ranges 3 years ago
makefile.dj 4d2f800677 curl.se: new home 3 years ago
multi-app.c ac0a88fd25 copyright: fix year ranges 3 years ago
multi-debugcallback.c ac0a88fd25 copyright: fix year ranges 3 years ago
multi-double.c ac0a88fd25 copyright: fix year ranges 3 years ago
multi-event.c 4d2f800677 curl.se: new home 3 years ago
multi-formadd.c ac0a88fd25 copyright: fix year ranges 3 years ago
multi-poll.c ac0a88fd25 copyright: fix year ranges 3 years ago
multi-post.c ac0a88fd25 copyright: fix year ranges 3 years ago
multi-single.c a6d20b89db cleanup: fix two empty expression statement has no effect 3 years ago
multi-uv.c 4d2f800677 curl.se: new home 3 years ago
multithread.c 4d2f800677 curl.se: new home 3 years ago
opensslthreadlock.c ac0a88fd25 copyright: fix year ranges 3 years ago
parseurl.c ac0a88fd25 copyright: fix year ranges 3 years ago
persistent.c ac0a88fd25 copyright: fix year ranges 3 years ago
pop3-authzid.c ac0a88fd25 copyright: fix year ranges 3 years ago
pop3-dele.c ac0a88fd25 copyright: fix year ranges 3 years ago
pop3-list.c ac0a88fd25 copyright: fix year ranges 3 years ago
pop3-multi.c ac0a88fd25 copyright: fix year ranges 3 years ago
pop3-noop.c ac0a88fd25 copyright: fix year ranges 3 years ago
pop3-retr.c ac0a88fd25 copyright: fix year ranges 3 years ago
pop3-ssl.c ac0a88fd25 copyright: fix year ranges 3 years ago
pop3-stat.c ac0a88fd25 copyright: fix year ranges 3 years ago
pop3-tls.c ac0a88fd25 copyright: fix year ranges 3 years ago
pop3-top.c ac0a88fd25 copyright: fix year ranges 3 years ago
pop3-uidl.c ac0a88fd25 copyright: fix year ranges 3 years ago
post-callback.c f2ed79d8ee docs/examples: adjust prototypes for CURLOPT_READFUNCTION 3 years ago
postinmemory.c ac0a88fd25 copyright: fix year ranges 3 years ago
postit2-formadd.c ac0a88fd25 copyright: fix year ranges 3 years ago
postit2.c ac0a88fd25 copyright: fix year ranges 3 years ago
progressfunc.c ac0a88fd25 copyright: fix year ranges 3 years ago
resolve.c ac0a88fd25 copyright: fix year ranges 3 years ago
rtsp.c 0a5b8af777 examples: fix more empty expression statement has no effect 3 years ago
sampleconv.c ac0a88fd25 copyright: fix year ranges 3 years ago
sendrecv.c ac0a88fd25 copyright: fix year ranges 3 years ago
sepheaders.c ac0a88fd25 copyright: fix year ranges 3 years ago
sessioninfo.c 4d2f800677 curl.se: new home 3 years ago
sftpget.c ac0a88fd25 copyright: fix year ranges 3 years ago
sftpuploadresume.c f2ed79d8ee docs/examples: adjust prototypes for CURLOPT_READFUNCTION 3 years ago
shared-connection-cache.c ac0a88fd25 copyright: fix year ranges 3 years ago
simple.c ac0a88fd25 copyright: fix year ranges 3 years ago
simplepost.c ac0a88fd25 copyright: fix year ranges 3 years ago
simplessl.c ac0a88fd25 copyright: fix year ranges 3 years ago
smooth-gtk-thread.c ac0a88fd25 copyright: fix year ranges 3 years ago
smtp-authzid.c f2ed79d8ee docs/examples: adjust prototypes for CURLOPT_READFUNCTION 3 years ago
smtp-expn.c ac0a88fd25 copyright: fix year ranges 3 years ago
smtp-mail.c f2ed79d8ee docs/examples: adjust prototypes for CURLOPT_READFUNCTION 3 years ago
smtp-mime.c ac0a88fd25 copyright: fix year ranges 3 years ago
smtp-multi.c f2ed79d8ee docs/examples: adjust prototypes for CURLOPT_READFUNCTION 3 years ago
smtp-ssl.c f2ed79d8ee docs/examples: adjust prototypes for CURLOPT_READFUNCTION 3 years ago
smtp-tls.c f2ed79d8ee docs/examples: adjust prototypes for CURLOPT_READFUNCTION 3 years ago
smtp-vrfy.c afddaa6dec examples: fix comment syntax 3 years ago
sslbackend.c 4d2f800677 curl.se: new home 3 years ago
synctime.c 1451f4d2e1 examples: remove superfluous asterisk uses 3 years ago
threaded-shared-conn.c ac0a88fd25 copyright: fix year ranges 3 years ago
threaded-ssl.c ac0a88fd25 copyright: fix year ranges 3 years ago
url2file.c ac0a88fd25 copyright: fix year ranges 3 years ago
urlapi.c ac0a88fd25 copyright: fix year ranges 3 years ago
usercertinmem.c 1451f4d2e1 examples: remove superfluous asterisk uses 3 years ago
version-check.pl 4d2f800677 curl.se: new home 3 years ago
xmlstream.c ac0a88fd25 copyright: fix year ranges 3 years ago

README.md

libcurl examples

This directory is for libcurl programming examples. They are meant to show some simple steps on how you can build your own application to take full advantage of libcurl.

If you end up with other small but still useful example sources, please mail them for submission in future packages and on the website.

Building

The Makefile.example is an example makefile that could be used to build these examples. Just edit the file according to your system and requirements first.

Most examples should build fine using a command line like this:

`curl-config --cc --cflags --libs` -o example example.c

Some compilers don't like having the arguments in this order but instead want you do reorganize them like:

`curl-config --cc` -o example example.c `curl-config --cflags --libs`

Please do not use the curl.se site as a test target for your libcurl applications/experiments. Even if some of the examples use that site as a URL at some places, it doesn't mean that the URLs work or that we expect you to actually torture our website with your tests! Thanks.

Examples

Each example source code file is designed to be and work stand-alone and rather self-explanatory. The examples may at times lack the level of error checks you need in a real world, but that is then only for the sake of readability: to make the code smaller and easier to follow.