cURL Command Reference Cheat Sheet
A quick reference for common curl flags covering HTTP methods, headers, authentication, file transfer, and debugging output.
1 PageBeginnerFeb 18, 2026
Basic Requests
Sending common HTTP methods.
bash
curl https://api.example.com/users # GET requestcurl -X POST https://api.example.com/users # POST requestcurl -X PUT https://api.example.com/users/1 # PUT requestcurl -X DELETE https://api.example.com/users/1 # DELETE requestcurl -I https://api.example.com # HEAD request (headers only)
Headers & Data
Sending JSON payloads and custom headers.
bash
curl -X POST https://api.example.com/users \ -H "Content-Type: application/json" \ -H "Authorization: Bearer TOKEN" \ -d '{"name": "Alice", "age": 30}'curl -G https://api.example.com/search \ --data-urlencode "q=hello world" # URL-encode query params
Files & Output Control
Downloading, uploading, and formatting output.
bash
curl -O https://example.com/file.zip # save with remote filenamecurl -o out.zip https://example.com/file.zip # save with custom namecurl -F "file=@photo.jpg" https://api.example.com/upload # multipart uploadcurl -L https://example.com/redirect # follow redirectscurl -s -o /dev/null -w "%{http_code}\n" https://example.com # status code only
Useful Flags
Frequently used options for debugging and control.
- -v / --verbose- Show request/response headers and connection details
- -s / --silent- Suppress progress meter and error messages
- -i / --include- Include response headers in the output
- -k / --insecure- Skip TLS certificate verification (use only for local/dev testing)
- -u user:pass- Send HTTP basic authentication credentials
- --retry N- Retry the request N times on transient failure
- -c / -b- Save cookies to a file (`-c`) / send cookies from a file (`-b`)
Pro Tip
Use `curl -w "@format.txt"` with a custom format file (or inline `-w "%{time_total}\n"`) to capture precise timing metrics like DNS lookup and TTFB when diagnosing slow API calls.
Was this cheat sheet helpful?
Explore Topics
#CURLCommandReference#CURLCommandReferenceCheatSheet#ToolsOthers#Beginner#BasicRequests#HeadersData#FilesOutputControl#UsefulFlags#Functions#Networking#Security#CheatSheet#SkillVeris
Advertisement
Sri Hayavadhana Info-Tech
Professional Web Designing Services
- Responsive Websites
- E-commerce Solutions
- SEO Friendly Design
- Fast & Secure
- Support & Maintenance