curl/docs/examples
Viktor Szakats ea782134e5
autotools: simplify configuration in tests, examples
- GHA/windows: make a mingw autotools build static only.
- GHA/windows: fix a CI script issue with the build above.
- src: fix to pass `LIBCURL_PC_LIBS_PRIVATE` instead of `LINKFLAGS`.
  This makes the libs propagate to tunits, making the local hack there
  unnecessary. `LINKFLAGS` had this single use in the repo, and it was
  empty in local tests.
- tests: drop passing redundant `LIBCURL_PC_LDFLAGS_PRIVATE`.
- tests: drop redundant target name from config variables.
- examples, tests/client: drop `LIBDIR` temp variables with single uses.
- examples, tests: formatting to sync `Makefile.am` scripts with each
  other.

Closes #17661
2025-06-19 09:06:56 +02:00
..
.checksrc core: stop redefining E* macros on Windows, map EACCES, related fixes 2025-03-13 00:03:25 +01:00
.gitignore gitignore: restore explicit lists and fix them 2025-01-28 14:44:35 +01:00
10-at-a-time.c
adddocsref.pl
address-scope.c Makefile.mk: drop in favour of autotools and cmake (MS-DOS, AmigaOS3) 2024-12-16 23:20:55 +01:00
altsvc.c
anyauthput.c build: add Windows CE / CeGCC support, with CI jobs 2025-02-21 13:56:34 +01:00
block_ip.c windows: fix builds targeting WinXP, test it in CI 2025-05-22 13:04:28 +02:00
cacertinmem.c build: fix compiling with GCC 4.x versions 2025-01-22 11:26:15 +01:00
certinfo.c
chkspeed.c tidy-up: prefer return over exit(), fix fallouts 2025-02-28 13:11:41 +01:00
CMakeLists.txt cmake: drop passing redundant CURL_STATICLIB in examples and clients 2025-06-17 20:57:23 +02:00
connect-to.c
cookie_interface.c tidy-up: prefer return over exit(), fix fallouts 2025-02-28 13:11:41 +01:00
crawler.c examples/complicated: fix warnings, bump deprecated callback, tidy up 2024-12-20 17:56:35 +01:00
debug.c
default-scheme.c
ephiperfifo.c examples: prefer return over exit() (cont.) 2025-03-01 02:09:02 +01:00
evhiperfifo.c examples: prefer return over exit() (cont.) 2025-03-01 02:09:02 +01:00
externalsocket.c lib/src/docs/test: improve curl_easy_setopt() calls 2025-04-23 23:44:55 +02:00
fileupload.c build: add Windows CE / CeGCC support, with CI jobs 2025-02-21 13:56:34 +01:00
ftp-delete.c docs/examples: add ftp-delete.c 2025-06-05 12:17:21 +02:00
ftp-wildcard.c lib/src/docs/test: improve curl_easy_setopt() calls 2025-04-23 23:44:55 +02:00
ftpget.c
ftpgetinfo.c
ftpgetresp.c clang-tidy: add to CI, add cmake support, fix fallouts 2024-12-27 13:42:32 +01:00
ftpsget.c
ftpupload.c build: add Windows CE / CeGCC support, with CI jobs 2025-02-21 13:56:34 +01:00
ftpuploadfrommem.c
ftpuploadresume.c build: add Windows CE / CeGCC support, with CI jobs 2025-02-21 13:56:34 +01:00
getinfo.c
getinmemory.c
getredirect.c
getreferrer.c
ghiper.c examples: prefer return over exit() (cont.) 2025-03-01 02:09:02 +01:00
headerapi.c
hiperfifo.c examples: prefer return over exit() (cont.) 2025-03-01 02:09:02 +01:00
href_extractor.c
hsts-preload.c
htmltidy.c
htmltitle.cpp tidy-up: prefer return over exit(), fix fallouts 2025-02-28 13:11:41 +01:00
http-options.c
http-post.c
http2-download.c tidy-up: prefer return over exit(), fix fallouts 2025-02-28 13:11:41 +01:00
http2-pushinmemory.c
http2-serverpush.c
http2-upload.c tidy-up: prefer return over exit(), fix fallouts 2025-02-28 13:11:41 +01:00
http3-present.c
http3.c
httpcustomheader.c
httpput-postfields.c tidy-up: misc 2024-12-24 01:27:26 +01:00
httpput.c clang-tidy: add to CI, add cmake support, fix fallouts 2024-12-27 13:42:32 +01:00
https.c
imap-append.c
imap-authzid.c
imap-copy.c
imap-create.c
imap-delete.c
imap-examine.c
imap-fetch.c
imap-list.c
imap-lsub.c
imap-multi.c
imap-noop.c
imap-search.c
imap-ssl.c spelling: 'a' vs 'an' 2025-05-30 11:38:35 +02:00
imap-store.c
imap-tls.c
interface.c
ipv6.c lib/src/docs/test: improve curl_easy_setopt() calls 2025-04-23 23:44:55 +02:00
keepalive.c
localport.c
Makefile.am autotools: simplify configuration in tests, examples 2025-06-19 09:06:56 +02:00
Makefile.example
Makefile.inc tests: always make bundles, adapt build and tests 2025-06-14 21:08:23 +02:00
maxconnects.c
multi-app.c docs: use lowercase curl and libcurl 2025-01-02 17:15:54 +01:00
multi-debugcallback.c
multi-double.c
multi-event.c examples/complicated: fix warnings, bump deprecated callback, tidy up 2024-12-20 17:56:35 +01:00
multi-formadd.c build: tidy up deprecation suppression, enable warnings for clang 2024-09-21 00:59:52 +02:00
multi-legacy.c docs: use lowercase curl and libcurl 2025-01-02 17:15:54 +01:00
multi-post.c
multi-single.c
multi-uv.c examples/complicated: fix warnings, bump deprecated callback, tidy up 2024-12-20 17:56:35 +01:00
multithread.c spelling: 'a' vs 'an' 2025-05-30 11:38:35 +02:00
netrc.c
parseurl.c
persistent.c
pop3-authzid.c
pop3-dele.c
pop3-list.c
pop3-multi.c
pop3-noop.c
pop3-retr.c
pop3-ssl.c spelling: 'a' vs 'an' 2025-05-30 11:38:35 +02:00
pop3-stat.c
pop3-tls.c
pop3-top.c
pop3-uidl.c
post-callback.c
postinmemory.c
postit2-formadd.c build: tidy up deprecation suppression, enable warnings for clang 2024-09-21 00:59:52 +02:00
postit2.c
progressfunc.c
protofeats.c
range.c
README.md GHA: silence proselint warnings and an error 2024-10-15 16:44:17 +02:00
resolve.c
rtsp-options.c
sendrecv.c build: fix compiling with GCC 4.x versions 2025-01-22 11:26:15 +01:00
sepheaders.c
sessioninfo.c examples/complicated: fix warnings, bump deprecated callback, tidy up 2024-12-20 17:56:35 +01:00
sftpget.c lib/src/docs/test: improve curl_easy_setopt() calls 2025-04-23 23:44:55 +02:00
sftpuploadresume.c lib/src/docs/test: improve curl_easy_setopt() calls 2025-04-23 23:44:55 +02:00
shared-connection-cache.c
simple.c
simplepost.c
simplessl.c docs: use valid example domain names 2025-02-09 00:17:05 +01:00
smooth-gtk-thread.c
smtp-authzid.c
smtp-expn.c
smtp-mail.c
smtp-mime.c
smtp-multi.c
smtp-ssl.c spelling: 'a' vs 'an' 2025-05-30 11:38:35 +02:00
smtp-tls.c
smtp-vrfy.c
sslbackend.c
synctime.c tidy-up: drop parenthesis around return expression 2025-01-14 12:11:42 +01:00
threaded-ssl.c examples/complicated: fix warnings, bump deprecated callback, tidy up 2024-12-20 17:56:35 +01:00
unixsocket.c
url2file.c
urlapi.c
usercertinmem.c build: fix compiling with GCC 4.x versions 2025-01-22 11:26:15 +01:00
version-check.pl
websocket-cb.c
websocket.c build: fix MSVC UWP builds 2024-11-28 14:24:03 +01:00
xmlstream.c examples/complicated: fix warnings, bump deprecated callback, tidy up 2024-12-20 17:56:35 +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.