xutil.dev
Login

curl Cheatsheet

Quick reference for curl commands covering basic requests, headers, authentication, data posting, SSL/TLS, proxy, output, and debugging options

62 commands

curl {url}

Fetch data from URL

curl -X GET

Send GET request

curl -X POST

Send POST request

curl -X PUT

Send PUT request

curl -X DELETE

Send DELETE request

curl -X PATCH

Send PATCH request

curl -L

Follow redirects

curl -I

Fetch headers only (HEAD)

curl --max-time {sec}

Set maximum time for request

curl --connect-timeout {sec}

Set connection timeout

curl --retry {n}

Retry on failure

curl -H "Header: Value"

Send custom header

curl -H "Accept: ..."

Set Accept header

curl -H "Authorization: Bearer ..."

Bearer token authentication

curl -A "User-Agent"

Set User-Agent

curl -e "Referer"

Set Referer header

curl -b "cookies"

Send cookies

curl -c {file}

Save response cookies to file

curl -b {file}

Read cookies from file

curl -u user:pass

Basic authentication

curl --digest -u user:pass

Digest authentication

curl --ntlm -u user:pass

NTLM authentication

curl --negotiate -u :

Negotiate (Kerberos) authentication

curl --oauth2-bearer {token}

OAuth2 Bearer token

curl -n

Use .netrc for credentials

curl -d "data"

Send POST data

curl -d @{file}

Send POST data from file

curl --data-raw "data"

Send data without @ processing

curl --data-urlencode "data"

URL-encode and send data

curl -F "file=@{path}"

Upload file (multipart form)

curl -F "key=value"

Send multipart form data

curl -T {file}

Upload file via PUT

curl --json '{...}'

Send JSON data (auto Content-Type)

curl -k

Skip SSL certificate verification

curl --cacert {file}

Specify CA certificate file

curl --cert {file}

Specify client certificate

curl --key {file}

Specify private key file

curl --tlsv1.2

Use TLS 1.2

curl --tlsv1.3

Use TLS 1.3

curl --ciphers {list}

Specify cipher suites

curl -x {proxy}

Use HTTP proxy

curl --socks5 {proxy}

Use SOCKS5 proxy

curl --socks5-hostname {proxy}

SOCKS5 with DNS through proxy

curl --noproxy "hosts"

Specify hosts to bypass proxy

curl -U user:pass

Proxy authentication

curl -o {file}

Save output to file

curl -O

Save with remote filename

curl -s

Silent mode (hide progress)

curl -S

Show errors in silent mode

curl -#

Show progress bar

curl -C -

Resume download automatically

curl --limit-rate {speed}

Limit transfer rate

curl -v

Verbose output (req/res headers)

curl -vv

More verbose debug output

curl --trace {file}

Write full trace to file

curl --trace-ascii {file}

Write ASCII trace to file

curl -w "format"

Output response info in custom format

curl -w "%{time_total}"

Show total time

curl -w "%{size_download}"

Show download size

curl -w "%{speed_download}"

Show download speed

curl --resolve host:port:ip

Override DNS resolution

curl -D {file}

Save response headers to file