Download to STDOUT


Save response to file

Save to specified file name:

curl -o my_file

Save to file name from URL

curl -O

Fetch multiple files

curl -O -O

Continue/Resume download

After interruption of a download, resume using where '-' in '-C -' indicates resume at offset that was already downloaded. Otherwise an offset value can be provided.

curl -C -

Follow redirects

curl -L

Limit rate of transfer

In this example limit rate of transfer to 1000B per second

curl --limit-rate 1000B -O

Fetch if modified before/after time

Works for FTP and HTTP

Fetch if modified after 12/21/2017

curl -z 21-Dec-17

Fetch if modified before 12/21/2017

curl -z -21-Dec-17


curl -u username:password

FTP Auth

curl -u username:password -O

Upload to FTP

Upload one file

curl -u user:pass -T file.txt

Upload multiple files

curl -u user:pass -T "{file1.txt,file2.txt}"

Upload from STDIN

curl -u user:pass -T -


Print protocol details

curl -v

Dump data transfer

curl --trace

Send Mail

curl --mail-from --mail-rcpt smtp://

Send cookies

Send from file

curl -b cookie_file

Send value where name=value is a valid cookie string

curl -b "name=value"

Send multiple cookies

curl -b "name1=value1; name2=value2"

Skip session cookies

curl -b cookie_file -j

Save Cookies

curl -c cookie_file

Request Header

curl --header "HEADER1" --header "HEADER"

HTTP Method

Default method is GET but can specify POST, PATCH, PUT, and DELETE. Wonder what else is supported


curl -X POST

Post with parameters

curl -X POST

Post with parameters in request body

curl -X POST -d "p1=v1&p2=v2"

Post with JSON in request body

curl -X POST -d "{'name':'value'}"

Post with file in request body

curl -X POST -d @file.json

Post form parameters

curl -X POST -F foo=bar -F bar=baz

Post form parameters with upload

curl -X POST -F foo=bar -F bar=@file.png

Cookie File Format

Tab delimited set of cookies, one per line with the following values: