Last updated
Bearer Token Authentication
curl https://api.example.com/profile \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
Basic Authentication
curl https://api.example.com/admin \
-u "username:password"
# Or with explicit header
curl https://api.example.com/admin \
-H "Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ="
API Key in Header
curl https://api.example.com/data \
-H "X-API-Key: your-api-key-here"
API Key as Query Parameter
curl "https://api.example.com/data?api_key=your-api-key-here"
Form Data (URL-encoded)
curl -X POST https://api.example.com/login \
-H "Content-Type: application/x-www-form-urlencoded" \
--data-urlencode "username=alice" \
--data-urlencode "password=secret123"
Multipart Form Data (File Upload)
curl -X POST https://api.example.com/upload \
-F "file=@/path/to/document.pdf" \
-F "title=My Document" \
-H "Authorization: Bearer token123"
Follow Redirects + Timeout
curl -L \
--connect-timeout 10 \
--max-time 30 \
https://api.example.com/resource
Verbose Output for Debugging
curl -v https://api.example.com/users \
-H "Authorization: Bearer token123"
Save Response to File
curl https://api.example.com/export/report.csv \
-H "Authorization: Bearer token123" \
-o report.csv
Disable SSL Verification (Dev Only)
curl -k https://localhost:8443/api/test \
-H "Content-Type: application/json"
# WARNING: Never use -k in production — it disables certificate validation
OPTIONS Preflight Check
curl -X OPTIONS https://api.example.com/users \
-H "Origin: https://myapp.com" \
-H "Access-Control-Request-Method: POST" \
-H "Access-Control-Request-Headers: Content-Type, Authorization" \
-v
Common Use Cases
- Testing REST API endpoints during development
- Debugging authentication and header issues
- Automating HTTP requests in shell scripts
- Verifying API behavior before writing application code
- Generating curl commands for API documentation
- Testing file upload endpoints
Configure your request method, URL, headers, body, and authentication through the visual interface and get a ready-to-run curl command with an explanation of each flag used.
Examples
Simple GET Request
curl https://api.example.com/users
GET with Custom Headers
curl https://api.example.com/users \
-H "Accept: application/json" \
-H "X-API-Version: 2"
POST with JSON Body
curl -X POST https://api.example.com/users \
-H "Content-Type: application/json" \
-d '{"name": "Alice", "email": "alice@example.com", "role": "admin"}'