1
0
mirror of https://github.com/onkelbeh/cheatsheets.git synced 2026-08-16 05:54:53 +02:00
Files
cheatsheets/curl.md
Michael Hienle 4c1e81452a Add curl --silent (#839)
Signed-off-by: Michael Hienle <hienle.michael@gmail.com>
2018-11-07 15:50:57 -07:00

1.3 KiB

title, category, layout, updated
title category layout updated
Curl CLI 2017/sheet 2017-09-20

Options

Options

-o <file>    # --output: write to file
-u user:pass # --user: Authentication
-v           # --verbose
-vv          # Even more verbose
-s           # --silent
-I           # --head: headers only

Request

-X POST          # --request
-L               # follow link if page redirects 

Data

-d 'data'    # --data: HTTP post data, URL encoded (eg, status="Hello")
-d @file     # --data via file
-G           # --get: send -d data via get

Headers

-A <str>         # --user-agent
-b name=val      # --cookie
-b FILE          # --cookie
-H "X-Foo: y"    # --header
--compressed     # use deflate/gzip

SSL

    --cacert <file>
    --capath <dir>
-E, --cert <cert>     # --cert: Client cert file
    --cert-type       # der/pem/eng
-k, --insecure        # for self-signed certs

Examples

{: .-one-column}

# Post data:
curl -d password=x http://x.com/y
# Auth/data:
curl -u user:pass -d status="Hello" http://twitter.com/statuses/update.xml
# multipart file upload
curl -v -include --form key1=value1 --form upload=@localfilename URL