cURL / Mailing Lists / curl-users / Single Mail

curl-users

Creating cookie for authentication

From: Josh Luthman <josh_at_imaginenetworksllc.com>
Date: Sun, 16 Oct 2011 15:57:56 -0400

I am trying to create a cookie so that I can then use wget to obtain
an image embedded behind  a login page.

I am working with this HTML log in page:
http://pastebin.com/CP9YsbTr

Now I am trying to create a cookie with this command:
curl -silent -c inxcamcookie --form username=admin --form
password=thisismypasswd --form Submit=Login
http://10.10.10.191/login.cgi
curl -silent -c inxcamcookie --form
"username=admin&password=thisismypasswd&Submit=Login"
http://10.10.10.191/login.cgi

Based on the man page I believe both are functionally identical,
though I have not been successful in either to confirm.

However in doing either I get this error:
http://pastebin.com/G1542av5

I originally tried to do a curl -d but I believe that with a
Content-Type: multipart/form-data that a -f is absolutely required.
With the same syntax using -d the web server issued an incorrect
credentials error, presumably because there was "no data" in the
fields when I did a Submit/Login.

This is my first post to this list and I have read through the Curl
Mailing Etiquette so I believe this is up to spec. Please let me know
if otherwise.

Josh Luthman
Office: 937-552-2340
Direct: 937-552-2343
1100 Wayne St
Suite 1337
Troy, OH 45373

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-10-16