curl network
the one that started it all.
We’re not covering curl here. Someone already did it better than we ever could — and honestly, they’re the reason this site exists.
Go read justuse.org/curl — it’s the page that made us realize man pages needed an attitude adjustment.
We owe them a beer. Or at least some traffic.
But since you’re already here — we’re not going to let you leave empty-handed.
Cheat sheet
| What you’re doing | Command |
|---|---|
| Simple GET request | curl https://example.com |
| Save output to file | curl -o file.html https://example.com |
| Follow redirects | curl -L https://example.com |
| POST JSON data | curl -X POST -H "Content-Type: application/json" -d '{"key":"val"}' https://api.example.com |
| POST form data | curl -d "user=me&pass=secret" https://example.com/login |
| Send a custom header | curl -H "Authorization: Bearer TOKEN" https://api.example.com |
| Download a file (keep filename) | curl -O https://example.com/file.tar.gz |
| Show response headers | curl -I https://example.com |
| Show everything (verbose) | curl -v https://example.com |
| Send with a cookie | curl -b "session=abc123" https://example.com |
| Upload a file | curl -F "file=@/path/to/file.png" https://example.com/upload |
| Ignore SSL errors | curl -k https://self-signed.example.com |
| Set a timeout | curl --connect-timeout 5 -m 10 https://example.com |
| Pipe to jq for JSON | curl -s https://api.example.com/data | jq '.' |
Now go back to the list and pick something we actually wrote.