Cheatography
https://cheatography.com
curl is the most powerful command in linux
Cookies
-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
--data-binary |
@<filename> |
Does not process the file before sending. -d sends it in ASCII.
Insecure SSL
By default all insecure requests fail. With -k, insecure requests do not fail.
Authentication
-u |
<username:password> |
Proxy
Example :
-x 'http://proxy:2080'
Compression
Curl accepts compression encoding formats : gzip, deflate
|
|
POST Data
-d |
<@filename> |
-d |
<data> |
Adding an @ reads the data from file.
HTTP Method
Specify method to use : POST, HEAD, PUT, GET, DELETE
Write to file
Writes output to file instead of stdout
Connect Timeout
--connect-timeout <seconds> |
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 '%{remote_ip} %{time_total} %{http_code} \n' -o /dev/null http://ankush.io
|
|
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
Show Error
When used with -s, this shows an error when it fails.
Exit Codes
6 |
Can't resolve host |
7 |
Couldn't connect to host |
28 |
Operation timeout |
55 |
Failed to send data |
56 |
Failed to receive data |
|
Created By
Metadata
Favourited By
and 18 more ...
Comments
No comments yet. Add yours below!
Add a Comment
Related Cheat Sheets
More Cheat Sheets by [deleted]