Using Curl

$ curl URL

Flags

-v –verbose

  • mode shows you the state of curl as it is processing the request

-l –location

-d [str]

  • sends str to the URL
  • need double quotes if str has spaces in it

-d [@filename]

  • sends contents of file to URL

-u [username:password]

-w [text]

  • writes text tp stdout after curl completes

-o [filename]

  • output contents of curl to file
  • (alternate) curl http://example.com/filename

–compress

  • request server send compressed data.  curl decompresses data.

–limits-rate [#X]

  • Limits the download speed.  X can be K,M or G.

–max-filesize [size]

  • Checks file size prior to downloading. Wont download if exceeds max-filesize.

-T [data]

  • Upload data to server.

File URLs

file://hostname/path

hostname must be localhost or 127.0.0.1