everything and nothing

allskonar

Obsession with curl

December 18th, 2008

Ok, this is hardly worth putting down but it will work for me as a reminder. I have been loving the curl utility allot lately. I had a situation where I needed a to hit a page rather frequently and I really wanted to just stick it in a bash loop and just have it run. The problem is that the page was behind user/password credentials. But as it turns out curl can have it’s own cookie jar so it can sustain a session between requests. Here is how.


  curl -d "user[login]=username&user[password]=password" \\
  -c domain.cookie http://example.com/user/login

Also another trick I have been addicted to is curling a domain and only getting the response headers


curl -I http://domain.example.com

Who said I don’t like browsers?

Sorry, comments are closed for this article.

Freyja Channel


last.fm recent tracks

allskonar Powered by Mephisto