ipdetecto.com logo
ipdetecto.com
My IPSpeed
Knowledge Hub
HomeKnowledge HubLinux Curl Command Explained
© 2026 ipdetecto.com
support@ipdetecto.comAboutContactPrivacyTermsllms.txt
Basics
5 MIN READ
Apr 19, 2026

Linux curl Command Explained

Transfer URLs from the shell: methods, headers, TLS, output and timing options, and debugging HTTP APIs.

curl speaks HTTP, HTTPS, and many other protocols. Set methods with -X, headers with -H, and data with -d. For TLS, --cacert pins trust stores and -k skips verification only for controlled tests. -w prints timing variables after transfer—useful for latency splits. Save bodies with -o and show headers with -D or -i.

GoalFlagsNote
Follow redirects-LCombine with max-redirs for safety
JSON POST-H Content-Type: application/json -d @fileUse @ to load body from disk
Pin host to IP--resolveTest vhosts without DNS

Related

What curl does, curl vs wget, DNS troubleshooting, Linux networking commands

Frequently Asked Questions

Q.How do I show response headers with curl?

Use -i to include headers in stdout or -D file to write headers separately from the body.

Q.What does curl -w print?

After the transfer, -w outputs format variables such as time_namelookup and time_total for performance debugging.

Q.How do I send bearer token authentication?

Add Authorization with -H "Authorization: Bearer …" or use --oauth2-bearer when using OAuth2 client flows.

Q.Why does curl fail certificate verification?

Hostname mismatch, expired certs, or missing intermediates—inspect with -v and fix trust store or chain files.

Q.How can I throttle or limit download size?

Use --range for partial content or --max-filesize to abort when responses exceed a threshold.

Q.What is the difference between -d and -F?

-d sends application/x-www-form-urlencoded or raw data; -F builds multipart form uploads for files.

Q.How do I reuse cookies between requests?

Save with -c and load with -b to mimic browser sessions during API debugging.

Q.Does curl use HTTP/2 automatically?

Modern builds negotiate HTTP/2 over HTTPS when offered; use --http2 or --http1.1 to force a version for tests.
TOPICS & TAGS
curllinux HTTP clientcurl -wTLS curlREST debugging