#! /bin/bash
wget -r -P /download/location -A jpg,jpeg,gif,png http://www.example.com
# see here for file types: http://www.gnu.org/software/wget/manual/wget.html#Types-of-Files
# -nd No Directories
# curl
curl -v # verbose (show what is being sent)
curl <website> # print content to console
curl -o <file> <website> # write content to file
curl -O <website>/file.zip # write content to file (same name) -> download
curl -I/--head <website> # get header information HEAD
curl -H/--header "X-Authorization: content" <website> # send header
# data (Content-Type: application/x-www-form-urlencoded), has to be url encoded!
# - default for webforms!
curl --data/-d "birthyear=1905&press=%20OK%20" <url> # POST request
curl -d "birthyear=1905" -d "press=%20OK%20" <url>
curl -d @file <url>
curl --data-binary "@path/to/file" # does not strip out newlines
curl --data-urlencode "name=I am Daniel" <website> # if data is not urlencoded yet
# form (Content-Type: multipart/form-data), with seperator and other MIME data
curl --form/-F upload=@localfilename --form $form-sb-name=$form-sb-value <website>
curl --upload-file uploadfile # PUT
curl -X GET <website> # arbitrary method
-i, --include # include received headers in output