curl-curl/docs/examples
Viktor Szakats a041bf6ca2
Makefile.example: make default options more likely to work
- replace default libpaths with more common ones.
- drop Solaris network libs.

Closes #19161
2025-10-20 13:52:58 +02:00
..
.checksrc REUSE: move copyright headers to .checksrc 2025-10-13 11:54:22 +02:00
.gitignore examples: add an example for logging failed transfers 2025-10-09 14:40:09 -04:00
10-at-a-time.c examples: check more errors, fix cleanups, scope variables 2025-10-14 16:33:00 +02:00
adddocsref.pl scripts: enable strict warnings in Perl where missing, fix fallouts 2025-07-27 22:35:18 +02:00
address-scope.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
altsvc.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
anyauthput.c examples: check more errors, fix cleanups, scope variables 2025-10-14 16:33:00 +02:00
block_ip.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
cacertinmem.c examples: check more errors, fix cleanups, scope variables 2025-10-14 16:33:00 +02:00
certinfo.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
chkspeed.c examples: replace casts with curl_off_t printf masks 2025-10-19 13:16:32 +02:00
CMakeLists.txt cmake: support building some complicated examples, build them in CI 2025-10-07 19:09:02 +02:00
connect-to.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
cookie_interface.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
crawler.c examples: check more errors, fix cleanups, scope variables 2025-10-14 16:33:00 +02:00
debug.c examples: check more errors, fix cleanups, scope variables 2025-10-14 16:33:00 +02:00
default-scheme.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
ephiperfifo.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
evhiperfifo.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
externalsocket.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
fileupload.c examples: replace casts with curl_off_t printf masks 2025-10-19 13:16:32 +02:00
ftp-delete.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
ftp-wildcard.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
ftpget.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
ftpgetinfo.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
ftpgetresp.c examples: check more errors, fix cleanups, scope variables 2025-10-14 16:33:00 +02:00
ftpsget.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
ftpupload.c examples: replace casts with curl_off_t printf masks 2025-10-19 13:16:32 +02:00
ftpuploadfrommem.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
ftpuploadresume.c examples: check more errors, fix cleanups, scope variables 2025-10-14 16:33:00 +02:00
getinfo.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
getinmemory.c examples: check more errors, fix cleanups, scope variables 2025-10-14 16:33:00 +02:00
getredirect.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
getreferrer.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
ghiper.c examples: check more errors, fix cleanups, scope variables 2025-10-14 16:33:00 +02:00
headerapi.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
hiperfifo.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
hsts-preload.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
htmltidy.c examples: check more errors, fix cleanups, scope variables 2025-10-14 16:33:00 +02:00
htmltitle.cpp examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
http2-download.c examples: check more errors, fix cleanups, scope variables 2025-10-14 16:33:00 +02:00
http2-pushinmemory.c examples: check more errors, fix cleanups, scope variables 2025-10-14 16:33:00 +02:00
http2-serverpush.c examples: check more errors, fix cleanups, scope variables 2025-10-14 16:33:00 +02:00
http2-upload.c examples: check more errors, fix cleanups, scope variables 2025-10-14 16:33:00 +02:00
http3-present.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
http3.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
http-options.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
http-post.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
httpcustomheader.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
httpput-postfields.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
httpput.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
https.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
imap-append.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
imap-authzid.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
imap-copy.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
imap-create.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
imap-delete.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
imap-examine.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
imap-fetch.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
imap-list.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
imap-lsub.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
imap-multi.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
imap-noop.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
imap-search.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
imap-ssl.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
imap-store.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
imap-tls.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
interface.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
ipv6.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
keepalive.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
localport.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
log_failed_transfers.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
Makefile.am cmake: support building some complicated examples, build them in CI 2025-10-07 19:09:02 +02:00
Makefile.example Makefile.example: make default options more likely to work 2025-10-20 13:52:58 +02:00
Makefile.inc examples: add an example for logging failed transfers 2025-10-09 14:40:09 -04:00
maxconnects.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
multi-app.c examples: check more errors, fix cleanups, scope variables 2025-10-14 16:33:00 +02:00
multi-debugcallback.c examples: check more errors, fix cleanups, scope variables 2025-10-14 16:33:00 +02:00
multi-double.c examples: check more errors, fix cleanups, scope variables 2025-10-14 16:33:00 +02:00
multi-event.c examples: check more errors, fix cleanups, scope variables 2025-10-14 16:33:00 +02:00
multi-formadd.c examples: check more errors, fix cleanups, scope variables 2025-10-14 16:33:00 +02:00
multi-legacy.c examples: check more errors, fix cleanups, scope variables 2025-10-14 16:33:00 +02:00
multi-post.c examples: check more errors, fix cleanups, scope variables 2025-10-14 16:33:00 +02:00
multi-single.c examples: check more errors, fix cleanups, scope variables 2025-10-14 16:33:00 +02:00
multi-uv.c examples: check more errors, fix cleanups, scope variables 2025-10-14 16:33:00 +02:00
multithread.c examples: check more errors, fix cleanups, scope variables 2025-10-14 16:33:00 +02:00
netrc.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
parseurl.c examples: use present tense in comments 2024-02-27 16:19:43 +01:00
persistent.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
pop3-authzid.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
pop3-dele.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
pop3-list.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
pop3-multi.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
pop3-noop.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
pop3-retr.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
pop3-ssl.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
pop3-stat.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
pop3-tls.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
pop3-top.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
pop3-uidl.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
post-callback.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
postinmemory.c examples: check more errors, fix cleanups, scope variables 2025-10-14 16:33:00 +02:00
postit2-formadd.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
postit2.c examples: check more errors, fix cleanups, scope variables 2025-10-14 16:33:00 +02:00
progressfunc.c examples: replace casts with curl_off_t printf masks 2025-10-19 13:16:32 +02:00
protofeats.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
range.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
README.md GHA: silence proselint warnings and an error 2024-10-15 16:44:17 +02:00
resolve.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
rtsp-options.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
sendrecv.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
sepheaders.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
sessioninfo.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
sftpget.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
sftpuploadresume.c examples: replace casts with curl_off_t printf masks 2025-10-19 13:16:32 +02:00
shared-connection-cache.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
simple.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
simplepost.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
simplessl.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
smooth-gtk-thread.c examples: check more errors, fix cleanups, scope variables 2025-10-14 16:33:00 +02:00
smtp-authzid.c examples: check more errors, fix cleanups, scope variables 2025-10-14 16:33:00 +02:00
smtp-expn.c examples: check more errors, fix cleanups, scope variables 2025-10-14 16:33:00 +02:00
smtp-mail.c examples: check more errors, fix cleanups, scope variables 2025-10-14 16:33:00 +02:00
smtp-mime.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
smtp-multi.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
smtp-ssl.c examples: check more errors, fix cleanups, scope variables 2025-10-14 16:33:00 +02:00
smtp-tls.c examples: check more errors, fix cleanups, scope variables 2025-10-14 16:33:00 +02:00
smtp-vrfy.c examples: check more errors, fix cleanups, scope variables 2025-10-14 16:33:00 +02:00
sslbackend.c docs: use CURLSSLBACKEND_NONE 2023-09-21 14:15:03 +02:00
synctime.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
threaded-ssl.c examples: check more errors, fix cleanups, scope variables 2025-10-14 16:33:00 +02:00
unixsocket.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
url2file.c examples: check more errors, fix cleanups, scope variables 2025-10-14 16:33:00 +02:00
urlapi.c examples: check more errors, fix cleanups, scope variables 2025-10-14 16:33:00 +02:00
usercertinmem.c examples: check more errors, fix cleanups, scope variables 2025-10-14 16:33:00 +02:00
version-check.pl scripts: enable strict warnings in Perl where missing, fix fallouts 2025-07-27 22:35:18 +02:00
websocket-cb.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
websocket-updown.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
websocket.c examples/websocket: fix use of uninitialized rlen 2025-10-17 10:15:07 +02:00
xmlstream.c examples: check more errors, fix cleanups, scope variables 2025-10-14 16:33:00 +02:00

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-my 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-my 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.