Show Menu

cURL cheat sheet Cheat Sheet by [deleted]

curl is the most powerful command in linux

Follow Redirects



-b cookiejar
Send Cookies using cookiejar
-c cookiejar
Store Cookies in cookiejar
-b 'n1=v1; n2=v2'
Send raw cookies using -b

Send Binary Data

Does not process the file before sending. -d sends it in ASCII.

Insecure SSL

-k / --insecure
By default all insecure requests fail. With -k, insecure requests do not fail.




-x <pr­oxy>
Example :
-x 'http:­//p­rox­y:2080'


Curl accepts compre­ssion encoding formats : gzip, deflate


Adding an @ reads the data from file.

HTTP Method

Specify method to use : POST, HEAD, PUT, GET, DELETE

Output to file

-o <fi­len­ame>

Write to file

Writes output to file instead of stdout

Max operation time

-m <se­con­ds>

Connect Timeout

--conn­ect­-ti­meout <se­con­ds>
Specify maximum time allowed to connect to remote server

Write Out

Defines what to display on stdout after a completed and successful operation.
curl -s -w '%{rem­ote_ip} %{time­_total} %{http­_code} \n' -o /dev/null http:/­/an­

Send Header

-H <he­ade­r>

User Agent

-A 'User-­Age­nt-­Name'

Show Response Header

Prints response headers along with response content.

HEAD Request

Sends a HEAD request. Only response headers are printed.

Verbose output

Useful to inspect headers
> means data sent by curl
< means data received by curl

Silent mode

Does not output progress

Show Error

When used with -s, this shows an error when it fails.

Exit Codes

Can't resolve host
Couldn't connect to host
Operation timeout
Failed to send data
Failed to receive data


No comments yet. Add yours below!

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          HTTP Status Codes Cheat Sheet
          rsync Cheat Sheet
          wget Cheat Sheet

          More Cheat Sheets by [deleted]