cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Using cURL to Retrieve BugIDs from Cisco's Web Site

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Mon, 20 Oct 2008 20:16:45 -0700

On Mon, Oct 20, 2008 at 09:09:55PM -0500, Josh Anderson wrote:
> Thank you for your replies. I considered those extra form values, but
> I thought they would be typically not be sent anyways since they are
> inside of a seperate form. Regardless, I tried adding them with no
> success. I went ahead and added a user agent (just copied the one that
> my browser is using). I have made some additional changes, but still
> no luck. Here is my current mess:
>
> curl -c cookies.txt -b cookies.txt -L -k -A "Mozilla/4.0 (compatible;
> MSIE 6.0; Windows NT 5.1; SV1; InfoPath.1; .NET CLR 1.1.4322; .NET CLR
> 2.0.50727; .NET CLR 3.0.04506.30; MS-RTC LM 8)" -d "" -e
> "http://www.cisco.com" -G "http://cisco.com/cgi-bin/login" -d
> "USER=usernamehere&PASSWORD=passwordhere&target=http://cisco.com/cgi-bin/login&smauthreason=0&smquerydata=&smagentname=zjGKGqr62shoVBG6cNUdYNajdKPzmOFLa/ZkeebT0+NV+EcoXFhv/vB8k65Cw/+x&postpreservationdata=&SMENC=ISO-8859-1&SMLOCALE=US-EN"
> -e "http://cisco.com/cgi-bin/login" "http://cisco.com/cgi-bin/login"
> -d "method=fetchBugDetails&bugId=CSCsi78581" -e
> "http://cisco.com/cgi-bin/login" -G
> "http://tools.cisco.com/Support/BugToolKit/search/getBugDetails.do"
>
> Here is what I am thinking I need to do:
> 1) GET http://cisco.com/cgi-bin/login
> 2) POST http://cisco.com/cgi-bin/login (user, password, extra values)
> 3) GET http://tools.cisco.com/Support/BugToolKit/search/getBugDetails.do?method=fetchBugDetails&bugId=CSCsi78581
>
> Does it look like I'm even using the correct arguments for cURL? It
> appears that a cookie is being set, but all 3 requests simply display
> the login page. Any other thoughts?

You can't do a GET and a POST from the same curl command-line. You need at
least two. And is the URL you're POSTing to *really* the same as the URL
of the login page? And are you really expected to send your password
unencrypted?

I suggest after you make those changes looking at the output of
--trace-ascii and comparing it to LiveHTTPHeaders for the same request
and see what differences remain. It's hard to speculate at this end
of an e-mail because the site could require just about anything in its
requests.

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2008-10-21