curl
Daniël Stenberg
facts and praise
I'm fortunate that I am allowed to follow Daniël, lead programmer of the mightycurl. The reason I formulated the line in this way, is because only through the power of the FediVerse I've gotten a boost from someone I follow, who found a post of the lead programmer or curl interesting
stats:
install base => 20000*106 devices
20 billion+ installations!
curl is used in command lines or scripts to transfer data. curl is also libcurl, used in:
- cars
- television sets
- routers
- printers
- audio equipment
- mobile phones
- tablets
- medical devices
- settop boxes
- computer games
- media players
Curl is THE Internet transfer engine for countless software applications in over twenty billion installations!
curl is used daily by virtually every Internet-using human on the globe!
curl is 30 years old
Let that sink in!
Opinion
curl is mature critical network infrastructure software that we all need to have our internet powered software / hardware to function in respect to data transfer.
The syntax to use curl in simple implementations is IMHO quite easy. In case you need to know an extra option, the executable and libcurl have excellent documentation. End users normally interact with curl using the (elf) binary on Linux based POSIX operating systems. The more mature BSDs have another binary format
Just type curl to get an initial output which looks like this on my current system
curl
curl: try 'curl --help' or 'curl --manual' for more information
then type
curl --help
Usage: curl [options...] <url>
-d, --data <data> HTTP POST data
-f, --fail Fail fast with no output on HTTP errors
-h, --help <subject> Get help for commands
-o, --output <file> Write to file instead of stdout
-O, --remote-name Write output to file named as remote file
-i, --show-headers Show response headers in output
-s, --silent Silent mode
-T, --upload-file <file> Transfer local FILE to destination
-u, --user <user:password> Server user and password
-A, --user-agent <name> Send User-Agent <name> to server
-v, --verbose Make the operation more talkative
-V, --version Show version number and quit
This is not the full help; this menu is split into categories.
Use "--help category" to get an overview of all categories, which are:
auth, connection, curl, deprecated, dns, file, ftp, global, http, imap, ldap, output, pop3, post, proxy,
scp, sftp, smtp, ssh, telnet, tftp, timeout, tls, upload, verbose.
Use "--help all" to list all options
Use "--help [option]" to view documentation for a given option
When you type curl --manual|less you get the manpages which I delimited with less through a vertical pipe
_ _ ____ _
___| | | | _ \| |
/ __| | | | |_) | |
| (__| |_| | _ <| |___
\___|\___/|_| \_\_____|
NAME
curl - transfer a URL
SYNOPSIS
curl [options / URLs]
DESCRIPTION
curl is a tool for transferring data from or to a server using URLs. It
supports these protocols: DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP,
HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP,
SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET, TFTP, WS and WSS.
curl is powered by libcurl for all transfer-related features. See
libcurl(3) for details.
URL
The URL syntax is protocol-dependent. You find a detailed description in
RFC 3986.
I can also type man curl to get a nice output:
curl(1) curl Manual curl(1)
NAME
curl - transfer a URL
SYNOPSIS
curl [options / URLs]
DESCRIPTION
curl is a tool for transferring data from or to a server using URLs. It supports these protocols:
DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S,
RTMP, RTMPS, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET, TFTP, WS and WSS.
curl is powered by libcurl for all transfer-related features. See libcurl(3) for details.
URL
The URL syntax is protocol-dependent. You find a detailed description in RFC 3986.
If you provide a URL without a leading protocol:// scheme, curl guesses what protocol you want. It
then defaults to HTTP but assumes others based on often-used hostname prefixes. For example, for
hostnames starting with "ftp." curl assumes you want FTP.
You can specify any amount of URLs on the command line. They are fetched in a sequential manner in
the specified order unless you use -Z, --parallel. You can specify command line options and URLs
Manual page curl(1) line 1 (press h for help or q to quit)
The reasoning behind curl --manual is simple. On a machine without the manual system you still need access to the full manual. This is one of the reasons why man curl is also implemented as curl --manual
An important RFC is echoed to my terminal in the man curl output which is RFC 3986
A Uniform Resource Identifier (URI) is a compact sequence of
characters that identifies an abstract or physical resource. This
specification defines the generic URI syntax and a process for
resolving URI references that might be in relative form, along with
guidelines and security considerations for the use of URIs on the
Internet. The URI syntax defines a grammar that is a superset of all
valid URIs, allowing an implementation to parse the common components
of a URI reference without knowing the scheme-specific requirements
of every possible identifier. This specification does not define a
generative grammar for URIs; that task is performed by the individual
specifications of each URI scheme.
I shall not quote the whole RFC 3986 here. You can read all about it on the RFC site (see sources)
As you can see curl is thorougly documented, has all the features a simple end user needs to fetch all kind of data, scaled up all the way to the extensive complex features router hardware et all, needs to transfer data.
programming route
I came to this toot when I saw that certain external feature code, which lives in stable external libraries, is now being removed from curl. I should say the code is depreciated then phased out.
This is a logical step
- It takes resources to maintain external code
- If the (shared) libraries are stable and mature, it's much better to just call those libraries and be done.
- The more external code you can remove from your project the better it is for all the programmers
The same is also happening in the Linux kernel, they are following in the footsteps of curl
Conclusion
There is a treasure trove of information in the sources. Just reading the pages on RFC 3986 will keep you occupied for hours.
Have fun and keep reading / learning and programming!
sources:
https://curl.se/
https://www.rfc-editor.org/rfc/rfc3986
https://curl.se/mail/lib-2026-03/0026.html
#curl #programming #mathematics #linear #algebra #libcurl #Linux #BSD #freeBSD #openBSD #netBSD #POSIX #bash #csh #ksh #sh #fish #radio #TV #smartTV #router