curl-curl/docs/examples
Viktor Szakats d9d2e339ce
tidy-up: URLs (cont.) and mdlinkcheck
- add missing ending slashes.
  To avoid duplicates and to use canonical URLs.
- reapply lost updates.
  Follow-up to 2ae983bf4e #19879
- mdlinkcheck: include the `include` directory.
- mdlinkcheck: show unused whitelist items.
- mdlinkcheck: improve debug output.
- mdlinkcheck: delete redundant whitelist items.
- examples/simplessl: lowercase the protocol part.
- BINDINGS: replace one remaining HTTP URL with HTTPS.
  Issue: https://github.com/pycurl/pycurl/issues/892
- BINDINGS: fix a broken link.
- BINDINGS: follow a refresh content redirect.
- KNOWN_BUGS: whitespace.

Closes #19911
2025-12-10 01:21:07 +01:00
..
.checksrc build: stop overriding standard memory allocation functions 2025-11-28 10:44:26 +01:00
.gitignore examples: add an example for logging failed transfers 2025-10-09 14:40:09 -04:00
10-at-a-time.c tidy-up: URLs (cont.) and mdlinkcheck 2025-12-10 01:21:07 +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: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
altsvc.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
anyauthput.c examples: use 64-bit fstat on Windows 2025-12-09 13:38:17 +01:00
block_ip.c tidy-up: one more round of formatting nits 2025-12-04 19:30:59 +01:00
cacertinmem.c tidy-up: one more round of formatting nits 2025-12-04 19:30:59 +01:00
certinfo.c example: fix formatting nits 2025-11-28 15:01:59 +01:00
chkspeed.c build: tidy-up MSVC CRT warning suppression macros 2025-11-18 00:49:26 +01:00
CMakeLists.txt build: tidy-up MSVC CRT warning suppression macros 2025-11-18 00:49:26 +01:00
connect-to.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
cookie_interface.c example: fix formatting nits 2025-11-28 15:01:59 +01:00
crawler.c tidy-up: URLs (cont.) and mdlinkcheck 2025-12-10 01:21:07 +01:00
debug.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
default-scheme.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
ephiperfifo.c tidy-up: one more round of formatting nits 2025-12-04 19:30:59 +01:00
evhiperfifo.c tidy-up: one more round of formatting nits 2025-12-04 19:30:59 +01:00
externalsocket.c tidy-up: one more round of formatting nits 2025-12-04 19:30:59 +01:00
fileupload.c examples: use 64-bit fstat on Windows 2025-12-09 13:38:17 +01:00
ftp-delete.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
ftp-wildcard.c tidy-up: one more round of formatting nits 2025-12-04 19:30:59 +01:00
ftpget.c example: fix formatting nits 2025-11-28 15:01:59 +01:00
ftpgetinfo.c build: tidy-up MSVC CRT warning suppression macros 2025-11-18 00:49:26 +01:00
ftpgetresp.c tidy-up: one more round of formatting nits 2025-12-04 19:30:59 +01:00
ftpsget.c tidy-up: one more round of formatting nits 2025-12-04 19:30:59 +01:00
ftpupload.c examples: use 64-bit fstat on Windows 2025-12-09 13:38:17 +01:00
ftpuploadfrommem.c example: fix formatting nits 2025-11-28 15:01:59 +01:00
ftpuploadresume.c tidy-up: one more round of formatting nits 2025-12-04 19:30:59 +01:00
getinfo.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
getinmemory.c example: fix formatting nits 2025-11-28 15:01:59 +01:00
getredirect.c example: fix formatting nits 2025-11-28 15:01:59 +01:00
getreferrer.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
ghiper.c tidy-up: one more round of formatting nits 2025-12-04 19:30:59 +01:00
headerapi.c example: fix formatting nits 2025-11-28 15:01:59 +01:00
hiperfifo.c tidy-up: one more round of formatting nits 2025-12-04 19:30:59 +01:00
hsts-preload.c tidy-up: one more round of formatting nits 2025-12-04 19:30:59 +01:00
htmltidy.c tidy-up: one more round of formatting nits 2025-12-04 19:30:59 +01:00
htmltitle.cpp tidy-up: one more round of formatting nits 2025-12-04 19:30:59 +01:00
http2-download.c tidy-up: one more round of formatting nits 2025-12-04 19:30:59 +01:00
http2-pushinmemory.c example: fix formatting nits 2025-11-28 15:01:59 +01:00
http2-serverpush.c tidy-up: one more round of formatting nits 2025-12-04 19:30:59 +01:00
http2-upload.c examples: use 64-bit fstat on Windows 2025-12-09 13:38:17 +01:00
http3-present.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
http3.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
http-options.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
http-post.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
httpcustomheader.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
httpput-postfields.c example: fix formatting nits 2025-11-28 15:01:59 +01:00
httpput.c examples: use 64-bit fstat on Windows 2025-12-09 13:38:17 +01:00
https.c examples: fix minor typo 2025-11-25 08:58:03 +01:00
imap-append.c tidy-up: one more round of formatting nits 2025-12-04 19:30:59 +01:00
imap-authzid.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
imap-copy.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
imap-create.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
imap-delete.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
imap-examine.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
imap-fetch.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
imap-list.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
imap-lsub.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
imap-multi.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
imap-noop.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
imap-search.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
imap-ssl.c example: fix formatting nits 2025-11-28 15:01:59 +01:00
imap-store.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
imap-tls.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
interface.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
ipv6.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
keepalive.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
localport.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
log_failed_transfers.c example: fix formatting nits 2025-11-28 15:01:59 +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 tidy-up: URLs (cont.) and mdlinkcheck 2025-12-10 01:21:07 +01:00
multi-app.c tidy-up: one more round of formatting nits 2025-12-04 19:30:59 +01:00
multi-debugcallback.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
multi-double.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
multi-event.c tidy-up: one more round of formatting nits 2025-12-04 19:30:59 +01:00
multi-formadd.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
multi-legacy.c tidy-up: one more round of formatting nits 2025-12-04 19:30:59 +01:00
multi-post.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
multi-single.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
multi-uv.c tidy-up: one more round of formatting nits 2025-12-04 19:30:59 +01:00
multithread.c tidy-up: one more round of formatting nits 2025-12-04 19:30:59 +01:00
netrc.c example: fix formatting nits 2025-11-28 15:01:59 +01:00
parseurl.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +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: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
pop3-dele.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
pop3-list.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
pop3-multi.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
pop3-noop.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
pop3-retr.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
pop3-ssl.c examples: fix minor typo 2025-11-25 08:58:03 +01:00
pop3-stat.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
pop3-tls.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
pop3-top.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
pop3-uidl.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
post-callback.c tidy-up: one more round of formatting nits 2025-12-04 19:30:59 +01:00
postinmemory.c tidy-up: one more round of formatting nits 2025-12-04 19:30:59 +01:00
postit2-formadd.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
postit2.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
progressfunc.c tidy-up: one more round of formatting nits 2025-12-04 19:30:59 +01:00
protofeats.c tidy-up: one more round of formatting nits 2025-12-04 19:30:59 +01: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: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
rtsp-options.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
sendrecv.c tidy-up: one more round of formatting nits 2025-12-04 19:30:59 +01:00
sepheaders.c build: tidy-up MSVC CRT warning suppression macros 2025-11-18 00:49:26 +01:00
sessioninfo.c tidy-up: one more round of formatting nits 2025-12-04 19:30:59 +01:00
sftpget.c example: fix formatting nits 2025-11-28 15:01:59 +01:00
sftpuploadresume.c example: fix formatting nits 2025-11-28 15:01:59 +01:00
shared-connection-cache.c example: fix formatting nits 2025-11-28 15:01:59 +01:00
simple.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
simplepost.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
simplessl.c tidy-up: URLs (cont.) and mdlinkcheck 2025-12-10 01:21:07 +01:00
smooth-gtk-thread.c example: fix formatting nits 2025-11-28 15:01:59 +01:00
smtp-authzid.c tidy-up: one more round of formatting nits 2025-12-04 19:30:59 +01:00
smtp-expn.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
smtp-mail.c tidy-up: one more round of formatting nits 2025-12-04 19:30:59 +01:00
smtp-mime.c tidy-up: one more round of formatting nits 2025-12-04 19:30:59 +01:00
smtp-multi.c tidy-up: one more round of formatting nits 2025-12-04 19:30:59 +01:00
smtp-ssl.c tidy-up: one more round of formatting nits 2025-12-04 19:30:59 +01:00
smtp-tls.c tidy-up: one more round of formatting nits 2025-12-04 19:30:59 +01:00
smtp-vrfy.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
sslbackend.c example: fix formatting nits 2025-11-28 15:01:59 +01:00
synctime.c tidy-up: one more round of formatting nits 2025-12-04 19:30:59 +01:00
threaded-ssl.c example: fix formatting nits 2025-11-28 15:01:59 +01:00
unixsocket.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
url2file.c build: tidy-up MSVC CRT warning suppression macros 2025-11-18 00:49:26 +01:00
urlapi.c badwords: check indented lines in source code, fix fallouts 2025-11-15 13:25:02 +01:00
usercertinmem.c example: fix formatting nits 2025-11-28 15:01:59 +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 tidy-up: one more round of formatting nits 2025-12-04 19:30:59 +01:00
websocket-updown.c tidy-up: one more round of formatting nits 2025-12-04 19:30:59 +01:00
websocket.c tidy-up: one more round of formatting nits 2025-12-04 19:30:59 +01:00
xmlstream.c example: fix formatting nits 2025-11-28 15:01:59 +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.