Curl Flashcards
Curl
lists options and descriptions
curl –help
Curl
set the user agent
curl -A
curl –user-agent
ex
curl –user-agent “Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)” localhost:4567
Curl
include DATA with a POST request
curl -d
curl –data
ex
curl -X POST –data “username=admin&password=secret” localhost:4567/users/signin
Curl
set a custom HTTP header
curl -H
curl –header
ex
curl –header “Content-Type: text/xml” localhost:4567
Curl
include the response headers in the output
curl -i
curl –include
ex
curl -i localhost:4567
Curl
redirect output from stdout to specified FILE
curl -o
ex
curl -o ~/Desktop/file.txt localhost:4567
Curl
follow any redirect specified in Location header
curl -L
curl –location
ex
curl -L localhost:4567
Curl
specify a method other than GET
curl -X
ex
curl -X POST localhost:4567/users/signin
Curl
pass data to the server as a file
curl -b
curl –cookie
ex
curl -b cookie.txt localhost:4567
Curl
write cookie to FILE after operation
curl -c
curl –cookie-jar
ex
curl -c cookie.txt localhost:4567
Curl
creates necessary directory heirarchy
curl –create-dirs
ex
curl —create-dirs localhost:4567/some/sub/folder/index
Curl
make the operation more “talkative”
curl -v
curl –verbose
ex curl -v localhost:4567
Curl
curl –help
lists options and descriptions
Curl
curl -A
curl –user-agent
ex
curl –user-agent “Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)” localhost:4567
set the user agent
Curl
curl -d
curl –data
ex
curl -X POST –data “username=admin&password=secret” localhost:4567/users/signin
include DATA with a POST request