Index

Network

wget

get request
wget localhost:8080/path/file.zip
authentication
wget --user=me --password=secret localhost:8080/path/file.zip
specify destination directory/file
wget [url] -O [destination]
do not follow redirects
wget "http://example.com" --max-redirect=0
bypass certificate security checks
wget --no-check-certificate https://example.com/unsafe.html

curl

verbose
curl -v http://example.com
upload a file:
curl -X PUT [url] -F "file=@put.zip"
post request
curl -X POST [url]
post request with data
curl -X POST [url] -d "param1=value1&param2=value2"
curl -X POST [url] --data "param1=value1&param2=value2"
authentication
curl -u [username]:[password] [url]
header
curl -H "Content-Type: application/json" [url]
curl --header "Content-Type: application/json" [url]
cookie
curl -b "JSESSIONID=cookievalue" [url]
curl silent (hide progress bar)
curl -s [url]
follow redirects
curl -L [url]
curl --location [url]
timeout if cant connect
curl --connect-timeout [seconds] [url]
do DNS lookup
host [domain]