curl cheat

# post with HTTP Basic auth and file data
curl -H 'X-Requested-With: XMLHttpRequest' --user username:password \
  --form "key=value" \
  --form file=@filename.jpg \
  http://servername.com/endpoint
 
# HTTP HEAD request (just headers, no body)
curl -I http://foo.bar
 
# just get a file (L follows redirects)
curl -OL http://foo.bar/baz.tgz
 
# save a file with a name
curl -o zomg.tgz http://foo.bar/baz.tgz
 
# remember to quote URLs with ampersands, otherwise things will get backgrounded
curl -O "http://foo.bar/baz.html?yo=dawg&adventure=time"