cURL Cheatsheet
cURL
HTTP
API
Web Tools
Complete reference for cURL commands, from basic HTTP requests to advanced data transfer, authentication, and performance monitoring.
Quick Reference
🌐 Basic Requests
Essential HTTP GET, POST, PUT, DELETE operations
🔐 Authentication
Basic auth, tokens, and SSL certificate handling
📊 Data Transfer
Upload, download, and file operations
📈 Performance
Timing, debugging, and output formatting
Basic Commands
Help and Information
Show help
Show detailed help
Show manual page
Verbose Output
Enable verbose output
Enable extra verbose output
Basic Requests
Simple GET request
Display response headers only
Follow redirects
File Operations
Download Files
Redirect output to file
Write to specific file
Write to file with same name as remote
Download multiple files
Execute Remote Scripts
Execute remote bash script
HTTP Methods
GET Requests
Explicit GET request
GET with query parameters
POST Requests
POST with JSON data
POST with form data
POST data from file
PUT Requests
PUT with data
DELETE Requests
DELETE request
Authentication
cURL supports various authentication methods for secure API access.
Basic Authentication
Basic auth with username and password
Basic auth with prompt for password
Bearer Token Authentication
Authorization header with bearer token
API Key Authentication
API key in header
API key in query parameter
SSL and Security
Use SSL options carefully in production environments.
SSL Certificate Handling
Ignore SSL certificate errors
Specify CA certificate
Use client certificate
Headers and Cookies
Custom Headers
Add custom header
Multiple custom headers
Remove default header
Cookie Management
Send cookies
Save cookies to file
Load cookies from file
Advanced Options
Timeouts and Retries
Set connection timeout
Set maximum time for operation
Retry on failure
Proxy Settings
Use HTTP proxy
Use SOCKS proxy
Performance Monitoring
Use write-out options to monitor request performance and debug issues.
Basic Performance Metrics
Show response code
Show total time
Show download speed
Detailed Timing Information
Complete timing breakdown
Size information
Write-Out Format Variables
Response Information
Content type
Response code
Effective URL
Network Information
Remote IP address
Local IP address
Number of redirects
Configuration
Config File
Use config file
Default config file location
Sample config file content
Best Practices
Follow these cURL best practices for reliable and secure HTTP operations.
- Use HTTPS whenever possible for secure communication
- Set timeouts to prevent hanging requests
- Handle errors by checking response codes
- Use config files for repeated options
- Validate SSL certificates in production
- Log requests for debugging and monitoring
- Use appropriate HTTP methods (GET, POST, PUT, DELETE)
- Include proper headers for API compatibility
Learn More
Explore comprehensive cURL documentation
Written by
Deepak Jangra
Created At
Wed Jan 15 2025
Updated At
Fri Jun 13 2025