curl

Usage

curl [OPTIONS] URL

Flags

write to file

-o <file>
--output <file>

Authentication

https://devhints.io/curl
-u <user>:<pass>
--user <user>:<pass>

Verbose

-v
--verbose

Very Verbose

-vv

Silent

-s
--silent

Headers only

-I
--head

Request

-X POST
--request POST
-L

Data

HTTP post data, URL encoded (eg, status="Hello”)

-d 'data'
--data 'data'

data via file

-d @file
--data @file

send data via GET

-G
--get

Headers

user-agent

-A <str>
--user-agent <str>
-b name=val
--cookie name=val
-b FILE
--cookie FILE

Custom header

-H "X-Foo: y"
--header "X-Foo: y"

Use deflate/gzip

--compressed

SSL/TLS

--cacert <file>
--capath <dir>

Client cert file

-E <cert>
--cert <cert>

Cert type

--cert-type <der/pem/eng>

Ignore SSL

-k
--insecure

Examples

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

Also see