Yedaya Katsman 6e2d3db99f examples: add missing binaries to .gitignore 5 mesiacov pred
..
.checksrc 2f72ad44fc checksrc: ban gmtime/localtime 4 rokov pred
.gitignore 6e2d3db99f examples: add missing binaries to .gitignore 5 mesiacov pred
10-at-a-time.c 53b4dfe405 examples: delete unused includes 5 mesiacov pred
CMakeLists.txt dfdd978f7c cmake: add `BUILD_EXAMPLES` option to build examples 6 mesiacov pred
Makefile.am 2bc1d775f5 copyright: update all copyright lines and remove year ranges 1 rok pred
Makefile.example 5b060a4108 docs: rewrite to present tense 1 rok pred
Makefile.inc 5d75bcd2ea examples/range.c: add 10 mesiacov pred
Makefile.mk ba8752e556 Makefile.mk: drop Windows support 11 mesiacov pred
README.md 2bc1d775f5 copyright: update all copyright lines and remove year ranges 1 rok pred
adddocsref.pl 2bc1d775f5 copyright: update all copyright lines and remove year ranges 1 rok pred
address-scope.c 5b9955e0bd examples: fix/silence `-Wsign-conversion` 6 mesiacov pred
altsvc.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
anyauthput.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
cacertinmem.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
certinfo.c 2bc1d775f5 copyright: update all copyright lines and remove year ranges 1 rok pred
chkspeed.c 3829759bd0 build: enable missing OpenSSF-recommended warnings, with fixes 11 mesiacov pred
connect-to.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
cookie_interface.c 53b4dfe405 examples: delete unused includes 5 mesiacov pred
crawler.c aef74ae416 example/crawler: make it use a few more options 1 rok pred
debug.c 3829759bd0 build: enable missing OpenSSF-recommended warnings, with fixes 11 mesiacov pred
default-scheme.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
ephiperfifo.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
evhiperfifo.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
externalsocket.c d4b8589055 examples: fix compiling with MSVC 5 mesiacov pred
fileupload.c 2bc1d775f5 copyright: update all copyright lines and remove year ranges 1 rok pred
ftp-wildcard.c 5b9955e0bd examples: fix/silence `-Wsign-conversion` 6 mesiacov pred
ftpget.c 95a882d268 build: fix `-Wconversion`/`-Wsign-conversion` warnings 11 mesiacov pred
ftpgetinfo.c 2bc1d775f5 copyright: update all copyright lines and remove year ranges 1 rok pred
ftpgetresp.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
ftpsget.c 95a882d268 build: fix `-Wconversion`/`-Wsign-conversion` warnings 11 mesiacov pred
ftpupload.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
ftpuploadfrommem.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
ftpuploadresume.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
getinfo.c 2bc1d775f5 copyright: update all copyright lines and remove year ranges 1 rok pred
getinmemory.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
getredirect.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
getreferrer.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
ghiper.c 2cd78f525c misc: Fix typos in docs and lib 8 mesiacov pred
headerapi.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
hiperfifo.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
href_extractor.c 2bc1d775f5 copyright: update all copyright lines and remove year ranges 1 rok pred
hsts-preload.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
htmltidy.c 2bc1d775f5 copyright: update all copyright lines and remove year ranges 1 rok pred
htmltitle.cpp 127eb0d83a misc: fix spelling mistakes 1 rok pred
http-options.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
http-post.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
http2-download.c 53b4dfe405 examples: delete unused includes 5 mesiacov pred
http2-pushinmemory.c 53b4dfe405 examples: delete unused includes 5 mesiacov pred
http2-serverpush.c 53b4dfe405 examples: delete unused includes 5 mesiacov pred
http2-upload.c d4b8589055 examples: fix compiling with MSVC 5 mesiacov pred
http3-present.c 2bc1d775f5 copyright: update all copyright lines and remove year ranges 1 rok pred
http3.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
httpcustomheader.c 2bc1d775f5 copyright: update all copyright lines and remove year ranges 1 rok pred
httpput-postfields.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
httpput.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
https.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
imap-append.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
imap-authzid.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
imap-copy.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
imap-create.c 2bc1d775f5 copyright: update all copyright lines and remove year ranges 1 rok pred
imap-delete.c 2bc1d775f5 copyright: update all copyright lines and remove year ranges 1 rok pred
imap-examine.c 2bc1d775f5 copyright: update all copyright lines and remove year ranges 1 rok pred
imap-fetch.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
imap-list.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
imap-lsub.c 945db0d958 docs: remove use of the word 'very' 1 rok pred
imap-multi.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
imap-noop.c 2bc1d775f5 copyright: update all copyright lines and remove year ranges 1 rok pred
imap-search.c 2bc1d775f5 copyright: update all copyright lines and remove year ranges 1 rok pred
imap-ssl.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
imap-store.c 2bc1d775f5 copyright: update all copyright lines and remove year ranges 1 rok pred
imap-tls.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
interface.c 22130826b7 docs/examples/interface.c: show CURLOPT_INTERFACE use 1 rok pred
ipv6.c dd09f88f13 examples/ipv6.c: new example showing IPv6-only internet transfer 10 mesiacov pred
keepalive.c b77d627d24 tcpkeepalive: add CURLOPT_TCP_KEEPCNT and --keepalive-cnt 5 mesiacov pred
localport.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
maxconnects.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
multi-app.c 53b4dfe405 examples: delete unused includes 5 mesiacov pred
multi-debugcallback.c 53b4dfe405 examples: delete unused includes 5 mesiacov pred
multi-double.c 53b4dfe405 examples: delete unused includes 5 mesiacov pred
multi-event.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
multi-formadd.c 53b4dfe405 examples: delete unused includes 5 mesiacov pred
multi-legacy.c d4b8589055 examples: fix compiling with MSVC 5 mesiacov pred
multi-post.c 53b4dfe405 examples: delete unused includes 5 mesiacov pred
multi-single.c 53b4dfe405 examples: delete unused includes 5 mesiacov pred
multi-uv.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
multithread.c 2bc1d775f5 copyright: update all copyright lines and remove year ranges 1 rok pred
netrc.c 1404bcdeae examples/netrc.c: add 10 mesiacov pred
parseurl.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
persistent.c 53b4dfe405 examples: delete unused includes 5 mesiacov pred
pop3-authzid.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
pop3-dele.c 2bc1d775f5 copyright: update all copyright lines and remove year ranges 1 rok pred
pop3-list.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
pop3-multi.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
pop3-noop.c 2bc1d775f5 copyright: update all copyright lines and remove year ranges 1 rok pred
pop3-retr.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
pop3-ssl.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
pop3-stat.c 2bc1d775f5 copyright: update all copyright lines and remove year ranges 1 rok pred
pop3-tls.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
pop3-top.c 2bc1d775f5 copyright: update all copyright lines and remove year ranges 1 rok pred
pop3-uidl.c 2bc1d775f5 copyright: update all copyright lines and remove year ranges 1 rok pred
post-callback.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
postinmemory.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
postit2-formadd.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
postit2.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
progressfunc.c 2bc1d775f5 copyright: update all copyright lines and remove year ranges 1 rok pred
protofeats.c c9cff9262f docs/examples/protofeats.c: Outputs all protocols and features 1 rok pred
range.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
resolve.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
rtsp-options.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
sendrecv.c 5b9955e0bd examples: fix/silence `-Wsign-conversion` 6 mesiacov pred
sepheaders.c 53b4dfe405 examples: delete unused includes 5 mesiacov pred
sessioninfo.c 2bc1d775f5 copyright: update all copyright lines and remove year ranges 1 rok pred
sftpget.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
sftpuploadresume.c 2bc1d775f5 copyright: update all copyright lines and remove year ranges 1 rok pred
shared-connection-cache.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
simple.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
simplepost.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
simplessl.c 1087937992 misc: fix typos 7 mesiacov pred
smooth-gtk-thread.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
smtp-authzid.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
smtp-expn.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
smtp-mail.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
smtp-mime.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
smtp-multi.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
smtp-ssl.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
smtp-tls.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
smtp-vrfy.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
sslbackend.c c1ab33ed79 docs: use CURLSSLBACKEND_NONE 1 rok pred
synctime.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
threaded-ssl.c fd2315e5ae examples/threaded-ssl: remove locking callback code 5 mesiacov pred
unixsocket.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
url2file.c 53b4dfe405 examples: delete unused includes 5 mesiacov pred
urlapi.c 741b6853b9 examples: make use of CURLOPT_(REDIR_|)PROTOCOLS_STR 1 rok pred
usercertinmem.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
version-check.pl 2bc1d775f5 copyright: update all copyright lines and remove year ranges 1 rok pred
websocket-cb.c f540e43b9d examples: use present tense in comments 8 mesiacov pred
websocket.c d4b8589055 examples: fix compiling with MSVC 5 mesiacov pred
xmlstream.c 53b4dfe405 examples: delete unused includes 5 mesiacov pred

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 do not 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 does not 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.