Everything curl
The free book about curl written by Daniel Stenberg, the founder of the curl project. It covers the command-line tool from first requests to headers, authentication, uploads, cookies, TLS and debugging with verbose output, plus the library and the project itself. The definitive curl reference.
Book
Other
Daniel Stenberg
Reference
All
Free
What it is
Everything curl is a free book about curl, the tool and library used to transfer data with URLs, which ships with most operating systems. It is written by Daniel Stenberg, who founded the curl project, and is available on the web and as PDF and ePUB. It is published under a Creative Commons Attribution 4.0 licence and, as the author notes, is never quite finished, because curl keeps changing. Work on the book began in 2015.
Why developers need curl
curl is how you talk HTTP from the terminal. When an app says "network error", curl -v tells you whether DNS resolved, whether TLS succeeded, what status code came back and which headers were sent. You use it to test your own APIs, reproduce bugs, download files in scripts, check redirects and health endpoints on servers, and try an API before writing code for it. Browsers' developer tools can even copy a request as a curl command.
What the book covers
- The basics of the command line tool and URLs
- HTTP methods, headers, redirects, cookies and uploads
- Authentication and TLS, including certificate problems
- Verbose and trace output for debugging
- Using curl in scripts, and exit codes
- The libcurl library for programmers
- How the project is run and how to contribute
How to use it
Most readers do not read it cover to cover. Read the introduction and the HTTP chapters once, then use it as a reference: when you need to send JSON, follow redirects, save cookies or debug a TLS error, look up that section. Practise every option against a real endpoint, your own local API or a public test service.
Is it worth it?
Yes, especially the chapters on HTTP and debugging. Blog posts cover a few flags; this book explains why they behave as they do, from the person who knows the tool best.
Common questions
Do I need to know HTTP first? Some basics help, but the book explains what you need as it goes.
Is curl on my machine already? Usually yes, on macOS, Windows and most Linux distributions. Check with curl --version.
Is it free? Yes, in all formats.
Ready to start?
Opens on Daniel Stenberg in a new tab.
Stuck on something specific?
Writing only gets you so far. If you want an answer to your situation rather than the general case, book a session and we will work through it together. Sessions are free for approved Sefism members, and a few slots open each week.
Follow along
New writing, resources and project ideas land here first.