CURL Cheatsheet 2025

Essential curl commands for API development and testing. From basic GET requests to complex authentication flows.

No data uploaded – runs 100% in your browser
Used by developers in 120+ countries
v2025.1 • Updated Nov 2025
Leaderboard Ad

Basic Requests

GET Request

curl https://api.example.com/users

POST Request with JSON

curl -X POST https://api.example.com/users \
  -H "Content-Type: application/json" \
  -d '{"name": "John", "email": "john@example.com"}'

PUT Request

curl -X PUT https://api.example.com/users/1 \
  -H "Content-Type: application/json" \
  -d '{"name": "John Updated"}'

DELETE Request

curl -X DELETE https://api.example.com/users/1

Headers

Custom Headers

curl https://api.example.com/data \
  -H "Authorization: Bearer your_token" \
  -H "Accept: application/json" \
  -H "X-Custom-Header: value"

Authentication

Bearer Token

curl https://api.example.com/protected \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..."

Basic Auth

curl -u username:password https://api.example.com/secure

API Key

curl https://api.example.com/data?api_key=your_key
curl https://api.example.com/data \
  -H "X-API-Key: your_key"

Data Handling

Form Data

curl -X POST https://api.example.com/upload \
  -F "file=@/path/to/file.pdf" \
  -F "name=document"

URL-Encoded Data

curl -X POST https://api.example.com/login \
  --data-urlencode "email=user@example.com" \
  --data-urlencode "password=secret"

Read Data from File

curl -X POST https://api.example.com/data \
  -H "Content-Type: application/json" \
  -d @payload.json

Useful Options

Verbose Output

curl -v https://api.example.com/data

Follow Redirects

curl -L https://example.com/redirect

Save Response to File

curl -o output.json https://api.example.com/data

Silent Mode

curl -s https://api.example.com/data

Show Only Headers

curl -I https://api.example.com/data

Timeout

curl --connect-timeout 5 --max-time 10 https://api.example.com/data

SSL/TLS

Ignore SSL Errors (Development Only)

curl -k https://self-signed.example.com

Specify Certificate

curl --cacert /path/to/cert.pem https://api.example.com

Convert CURL to Code

Need to use these commands in your application? Convert them to your programming language:

Multiplex Ad

Related Resources