cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: "POST" option related question using cURL.

From: Suhas Tembe <stembe_at_att.net>
Date: Tue, 21 Oct 2003 08:13:38 -0400

Thanks for the suggestions. I used the -c instead of -D as:

curl -c cook.txt http://supplyweb.trw.com/supplyweb/general/default.asp

*** cook.txt ***
# Netscape HTTP Cookie File
# http://www.netscape.com/newsref/std/cookie_spec.html
# This file was generated by libcurl! Edit at your own risk.
supplyweb.trw.com FALSE / FALSE 0 ASPSESSIONIDSCATSRQA
AFFCLAKDHPJOEMJDFHALJPHF
***

Then, I did:

curl -v -b cook.txt -d "UserAccount=USER&AccessCode=PASSWORD&Locale=en-us&TimeZone=PST%3A-480&action-Submit=Login" http://supplyweb.trw.com/supplyweb/general/default.asp

It scrolls & the top portion looks like this: I can see that the same cookie saved in step 1 was sent.

* About to connect() to supplyweb.trw.com:80
* Connected to supplyweb.trw.com (65.77.58.24) port 80
> POST /supplyweb/general/default.asp HTTP/1.1
User-Agent: curl/7.10.7 (powerpc-ibm-aix4.3.2.0) libcurl/7.10.7 zlib/1.1.4
Host: supplyweb.trw.com
Pragma: no-cache
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
Cookie: ASPSESSIONIDSCATSRQA=AFFCLAKDHPJOEMJDFHALJPHF
Content-Length: 94
Content-Type: application/x-www-form-urlencoded
UserAccount=4542-134289&AccessCode=134289&Locale=en-us&TimeZone=PST%3A-480&actio
n-Submit=Login< HTTP/1.1 100 Continue
< Server: Microsoft-IIS/5.0
< Date: Tue, 21 Oct 2003 11:58:31 GMT
< HTTP/1.1 200 OK
< Server: Microsoft-IIS/5.0
< Date: Tue, 21 Oct 2003 11:58:31 GMT
< Content-Length: 8606
< Content-Type: text/html; Charset=ISO-8859-1
< Cache-control: private
..
..
..
..

However, at the very bottom I see that it says:

* Connection #0 left intact
* Closing connection #0

Could this be the problem??

Thanks,
Suhas

----- Original Message -----
From: "Daniel Stenberg" <daniel_at_haxx.se>
To: "Curl Mailinglist" <curl-users_at_lists.sourceforge.net>
Sent: Tuesday, October 21, 2003 2:15 AM
Subject: Re: "POST" option related question using cURL.

> On Mon, 20 Oct 2003, Suhas Tembe wrote:
>
> > 1). I first recorded the cookies as:
> > curl -D cook.txt http://supplyweb.trw.com/supplyweb/general/default.asp
>
> We generally recommend -c to store cookies in a more failsafe way. Or more
> specificly, reading cookies saved with -c is more failsafe than cookies saved
> with -D.
>
> > 2). I then decided to use the cook.txt & post as:
> >
> > curl -b cook.txt -d
> > "UserAccount=USER&AccessCode=PASSWORD&Locale=en-us&TimeZone=PST%3A-480&action-Submit=Login"
> > http://supplyweb.trw.com/supplyweb/general/default.asp
> >
> > This doesn't seem to have worked, because I see the default.asp page being
> > scrolled.
>
> Use -v and check if that cookie you saved in step 1 was sent off.
>
> > How do I know that I am logged-in?
>
> I don't know. How do you know when you use a browser?
>
> > Am I doing something wrong?
>
> No one but you can tell. If you just act exactly as your browser does when you
> login, you should be logged in fine.
>
> > The next step I would like to do after I "log in" is do a GET using:
> > http://supplyweb.trw.com/InventoryStatus.asp?cboSupplier=SUPPLIERNUM&status=all&action-select=Query
>
> Usually that's not a problem if you've logged in and have all the cookies etc
> saved so that the site considers you OK for it.
>
> --
> Daniel Stenberg -- curl: been grokking URLs since 1998
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by OSDN developer relations
> Here's your chance to show off your extensive product knowledge
> We want to know what you know. Tell us and you have a chance to win $100
> http://www.zoomerang.com/survey.zgi?HRPT1X3RYQNC5V4MLNSV3E54

-------------------------------------------------------
This SF.net email is sponsored by OSDN developer relations
Here's your chance to show off your extensive product knowledge
We want to know what you know. Tell us and you have a chance to win $100
http://www.zoomerang.com/survey.zgi?HRPT1X3RYQNC5V4MLNSV3E54
Received on 2003-10-21