cURL / Mailing Lists / curl-users / Single Mail

curl-users

http POST, still not working

From: Kyle Davenport <kyle_davenport_at_compusa.com>
Date: Tue, 08 Oct 2002 10:50:14 -0500

OK, I always thought I could duplicate any browser thing with curl, but
this asp server has so far thwarted me.

For a while I was trying this to set my cookies:
curl --dump-header ~/headers -d "name=username&passwd=password"
http://weareit/support/login.asp

followed by:
curl -v -b ~/headers -d "stuff" http://weareit/workitem...

and it kept redirecting me to login. I eventually realized it was
sending two cookies and this procedure wasn't handling that. So with
both cookies in hand, now I get the dreaded "Object moved" and it
redirects me to the same url I was using!

I have verified I am setting the same form fields, using
cgi-bin/post-query and also changing POST to GET. (In anticipation, yes
I've tried user-agent and referer tricks and read The Art Of Scripting
HTTP Request Using Curl)

Here is my current attempt:
curl -v -b "ASPSESSIONIDQGGQGLZC=DDDGBCGCLOKPDINKAEJIEMMI;
WeAreIT%5Fuser=profileorg=118&lastname=Davenport&profiledept=241&profile%5Fid=525&middlename=&timestamp=10%2F7%2F2002+4%3A26%3A52+PM&profileteam=485&username=kdaven&profileemail=kyle%5Fdavenport%40compusa%2Ecom&securitylevel=1&firstname=Kyle"
-d
"action=insertTime&menuOption=&intProfile_id=525&month=08&day=20&year=2002&system=538&workitem=11200&activity=562&task=834&hour=8&hourfraction=.0&description=support"
weareit/workitem/workitem_time.asp

Here is the debug output:
* Connected to weareit.compusa.com (172.25.17.118)
> POST /workitem/workitem_time.asp HTTP/1.0
User-Agent: curl/6.2 (i686-pc-linux-gnu) libcurl 6.2
Cookie: ASPSESSIONIDQGGQGLZC=DDDGBCGCLOKPDINKAEJIEMMI;
WeAreIT%5Fuser=profileorg=118&lastname=Davenport&profiledept=241&profile%5Fid=525&middlename=&timestamp=10%2F7%2F2002+4%3A26%3A52+PM&profileteam=485&username=kdaven&profileemail=kyle%5Fdavenport%40compusa%2Ecom&securitylevel=1&firstname=Kyle
Host: weareit
Pragma: no-cache
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
> Content-Length: 164
Content-Type: application/x-www-form-urlencoded

action=insertTime&menuOption=&intProfile_id=525&month=08&day=20&year=2002&system=538&workitem=11200&activity=562&task=834&hour=8&hourfraction=.0&description=support
<head><title>Object moved</title></head>
<body><h1>Object Moved</h1>This object may be found <a
HREF="workitem_time.asp">here</a>.</body>

Unfortunately, I do not have access to the asp server. Any help much
appreciated. Please cc me.

<http://curl.haxx.se/docs/httpscripting.html>

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Received on 2002-10-08