cURL: a quick intro

Here you can find a short practical intro to cURL.

cURL

Show website.
curl www.mydomain.com

Sending post
curl -d “name1=value1&name2=value2″ www.mydomain.com

Save output in a file
curl -o out.txt www.mydomain.com

Spoof the Referer
curl -e www.here-i-am-from.com www.mydomain.com

Spoof  User Agent
curl -A ‘SuperGC Microsoft 7.5′ www.mydomain.com

Spoof Cookies
curl -b =”name=value” www.mydomain.com

Catch and use Cookies
curl –dump-header header www.mydomain.com
curl -b header www.mydomain.com

curl -c cookies.txt www.mydomain.com
curl -b cookies.txt -c cookies.txt www.mydomain.com

cURL Timing
Abort if to slow, if you do not download 300 bytes (-Y) every seconds for one minute, 60 seconds (-y) then stop download
curl -Y 300 -y 60 www.mydomain.com

Set overall timelimit with -m
curl -m 10 www.mydomain.com

Limit the transferrate per second
curl –limit-rate 10K www.mydomain.com (same as)
curl –limit-rate 10240 www.mydomain.com

Prevent cURL from upload (-T upload) in a packet size (–limit-rate) of 1 mb per second
curl -T upload.file www.mydomain.com

Setting Headers
curl -H “Balbla: This is the value :) ” www.mydomain.com

Prevent to send specific headers with -H “name:”
curl -H “host:” www.mydomain.com

  • Digg
  • del.icio.us
  • Facebook
  • Technorati
  • Twitthis
  • FriendFeed

POST A COMMENT

  • You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>