curl-curl/docs/examples
Viktor Szakats 1b48c6148a
tidy-up: miscellaneous
- schannel: delete superfluous parenthesis.
- tftp: delete stray space from log output.
- ws: update guard comment.
- docs/examples: constify variables.
- runtests/servers: enclose unknown parameter between quotes.
- scripts/perlcheck.sh: drop redundant grep `-E` option.
- THANKS: move names from comments to THANKS.
- sync `--depth` option style across scripts.
- sync git repo URL ending between some scripts.
- BINDINGS.md: drop protocol from archive.org URL path.
- whitespace, indent, unfold lines.

Closes #19565
2025-11-17 13:32:43 +01:00
..
.checksrc checksrc: disallow atoi and atol globally 2025-11-13 14:28:25 +01:00
.gitignore examples: add an example for logging failed transfers 2025-10-09 14:40:09 -04:00
10-at-a-time.c examples: consistent variable naming across examples 2025-10-31 16:44:57 +01: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 build: drop Windows CE / CeGCC support 2025-11-15 15:35:23 +01:00
block_ip.c build: drop Windows CE / CeGCC support 2025-11-15 15:35:23 +01:00
cacertinmem.c examples: consistent variable naming across examples 2025-10-31 16:44:57 +01:00
certinfo.c examples: consistent variable naming across examples 2025-10-31 16:44:57 +01:00
chkspeed.c examples: consistent variable naming across examples 2025-10-31 16:44:57 +01:00
CMakeLists.txt cmake: support building some complicated examples, build them in CI 2025-10-07 19:09:02 +02:00
connect-to.c badwords: check indented lines in source code, fix fallouts 2025-11-15 13:25:02 +01:00
cookie_interface.c badwords: check indented lines in source code, fix fallouts 2025-11-15 13:25:02 +01:00
crawler.c tidy-up: miscellaneous 2025-11-17 13:32:43 +01:00
debug.c badwords: check indented lines in source code, fix fallouts 2025-11-15 13:25:02 +01:00
default-scheme.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
ephiperfifo.c badwords: check indented lines in source code, fix fallouts 2025-11-15 13:25:02 +01:00
evhiperfifo.c examples: consistent variable naming across examples 2025-10-31 16:44:57 +01:00
externalsocket.c build: drop Windows CE / CeGCC support 2025-11-15 15:35:23 +01:00
fileupload.c build: drop Windows CE / CeGCC support 2025-11-15 15:35:23 +01:00
ftp-delete.c examples: consistent variable naming across examples 2025-10-31 16:44:57 +01:00
ftp-wildcard.c examples: consistent variable naming across examples 2025-10-31 16:44:57 +01:00
ftpget.c examples: consistent variable naming across examples 2025-10-31 16:44:57 +01: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: consistent variable naming across examples 2025-10-31 16:44:57 +01:00
ftpupload.c build: drop Windows CE / CeGCC support 2025-11-15 15:35:23 +01:00
ftpuploadfrommem.c tidy-up: miscellaneous 2025-11-17 13:32:43 +01:00
ftpuploadresume.c tidy-up: miscellaneous 2025-11-17 13:32:43 +01:00
getinfo.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
getinmemory.c examples: consistent variable naming across examples 2025-10-31 16:44:57 +01: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 tidy-up: miscellaneous 2025-11-17 13:32:43 +01:00
headerapi.c tidy-up: miscellaneous 2025-11-17 13:32:43 +01:00
hiperfifo.c examples: consistent variable naming across examples 2025-10-31 16:44:57 +01:00
hsts-preload.c examples: consistent variable naming across examples 2025-10-31 16:44:57 +01:00
htmltidy.c badwords: check indented lines in source code, fix fallouts 2025-11-15 13:25:02 +01:00
htmltitle.cpp badwords: check indented lines in source code, fix fallouts 2025-11-15 13:25:02 +01:00
http2-download.c build: drop Windows CE / CeGCC support 2025-11-15 15:35:23 +01:00
http2-pushinmemory.c examples: consistent variable naming across examples 2025-10-31 16:44:57 +01:00
http2-serverpush.c badwords: check indented lines in source code, fix fallouts 2025-11-15 13:25:02 +01:00
http2-upload.c tidy-up: miscellaneous 2025-11-17 13:32:43 +01:00
http3-present.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
http3.c badwords: check indented lines in source code, fix fallouts 2025-11-15 13:25:02 +01: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 build: drop Windows CE / CeGCC support 2025-11-15 15:35:23 +01:00
https.c badwords: check indented lines in source code, fix fallouts 2025-11-15 13:25:02 +01:00
imap-append.c examples: consistent variable naming across examples 2025-10-31 16:44:57 +01: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: consistent variable naming across examples 2025-10-31 16:44:57 +01: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 badwords: check indented lines in source code, fix fallouts 2025-11-15 13:25:02 +01: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 build: drop Windows CE / CeGCC support 2025-11-15 15:35:23 +01: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: consistent variable naming across examples 2025-10-31 16:44:57 +01:00
multi-debugcallback.c tidy-up: miscellaneous 2025-11-17 13:32:43 +01:00
multi-double.c examples: consistent variable naming across examples 2025-10-31 16:44:57 +01:00
multi-event.c examples: consistent variable naming across examples 2025-10-31 16:44:57 +01:00
multi-formadd.c badwords: check indented lines in source code, fix fallouts 2025-11-15 13:25:02 +01:00
multi-legacy.c examples: consistent variable naming across examples 2025-10-31 16:44:57 +01:00
multi-post.c examples: consistent variable naming across examples 2025-10-31 16:44:57 +01:00
multi-single.c examples: consistent variable naming across examples 2025-10-31 16:44:57 +01:00
multi-uv.c examples: consistent variable naming across examples 2025-10-31 16:44:57 +01:00
multithread.c badwords: check indented lines in source code, fix fallouts 2025-11-15 13:25:02 +01:00
netrc.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
parseurl.c badwords: check indented lines in source code, fix fallouts 2025-11-15 13:25:02 +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: consistent variable naming across examples 2025-10-31 16:44:57 +01: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 badwords: check indented lines in source code, fix fallouts 2025-11-15 13:25:02 +01: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: consistent variable naming across examples 2025-10-31 16:44:57 +01:00
postinmemory.c examples: consistent variable naming across examples 2025-10-31 16:44:57 +01: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 badwords: check indented lines in source code, fix fallouts 2025-11-15 13:25:02 +01:00
sendrecv.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
sepheaders.c examples: consistent variable naming across examples 2025-10-31 16:44:57 +01:00
sessioninfo.c examples: consistent variable naming across examples 2025-10-31 16:44:57 +01:00
sftpget.c examples: consistent variable naming across examples 2025-10-31 16:44:57 +01:00
sftpuploadresume.c build: drop Windows CE / CeGCC support 2025-11-15 15:35:23 +01:00
shared-connection-cache.c examples: consistent variable naming across examples 2025-10-31 16:44:57 +01:00
simple.c badwords: check indented lines in source code, fix fallouts 2025-11-15 13:25:02 +01:00
simplepost.c badwords: check indented lines in source code, fix fallouts 2025-11-15 13:25:02 +01:00
simplessl.c examples: fix more potential resource leaks, and more 2025-10-31 13:35:53 +01:00
smooth-gtk-thread.c badwords: check indented lines in source code, fix fallouts 2025-11-15 13:25:02 +01:00
smtp-authzid.c examples: consistent variable naming across examples 2025-10-31 16:44:57 +01:00
smtp-expn.c examples: check more errors, fix cleanups, scope variables 2025-10-14 16:33:00 +02:00
smtp-mail.c examples: consistent variable naming across examples 2025-10-31 16:44:57 +01: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: consistent variable naming across examples 2025-10-31 16:44:57 +01:00
smtp-ssl.c badwords: check indented lines in source code, fix fallouts 2025-11-15 13:25:02 +01:00
smtp-tls.c examples: consistent variable naming across examples 2025-10-31 16:44:57 +01: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: consistent variable naming across examples 2025-10-31 16:44:57 +01:00
threaded-ssl.c badwords: check indented lines in source code, fix fallouts 2025-11-15 13:25:02 +01:00
unixsocket.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
url2file.c examples: consistent variable naming across examples 2025-10-31 16:44:57 +01:00
urlapi.c badwords: check indented lines in source code, fix fallouts 2025-11-15 13:25:02 +01:00
usercertinmem.c examples: consistent variable naming across examples 2025-10-31 16:44:57 +01: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: consistent variable naming across examples 2025-10-31 16:44:57 +01:00
websocket-updown.c tidy-up: result code variable names in tests and examples 2025-11-14 01:47:12 +01:00
websocket.c examples/websocket: fix use of uninitialized rlen 2025-10-17 10:15:07 +02:00
xmlstream.c examples: consistent variable naming across examples 2025-10-31 16:44:57 +01: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.