cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: what i'm doing wrong?

From: STEVE STEFANOVICH <STEVE.STEFANOVICH_at_sydneywater.com.au>
Date: Thu, 08 Nov 2001 11:06:59 +1000

OK, trying this

**********
curl -c cookies.txt -D hdump.txt -v -i -b empty
-L -x myproxy:8080 -d "xxx&password=yyy&submit=Submit" http://www.vreme.com/account/login_action.php > output.txt

**********

I get

************

* Connected to myproxy [x.y.z.d]
> POST http://www.vreme.com/account/login_action.php HTTP/1.1

User-Agent: curl/7.9 (win32) libcurl 7.9

Host: www.vreme.com

Pragma: no-cache

Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*

Content-Length: 65

Content-Type: application/x-www-form-urlencoded

username=xxx&password=yyy&submit=Submit

  % Total % Received % Xferd Average Speed Time Curr.
                                 Dload Upload Total Current Left Speed

  0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0
  0 0 0 0 0 0 0 0 --:--:-- 0:00:02 --:--:-- 0
  0 0 0 0 0 0 0 0 --:--:-- 0:00:02 --:--:-- 0
* Connection (#0) left alive
* Follows Location: to new URL: 'http://www.vreme.com/'
* Disables POST, goes with GET
* Re-using existing connection! (#0)
* Connected to myproxy [x.y.z.d]
> GET http://www.vreme.com/ HTTP/1.1

User-Agent: curl/7.9 (win32) libcurl 7.9

Host: www.vreme.com

Pragma: no-cache

Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*

Cookie: PHPSESSID=20eff5aa1688379145249393982c59f3

  0 0 0 0 0 0 0 0 --:--:-- 0:00:02 --:--:-- 0
* Connection (#0) left alive
* Closing live connection (#0)

*****************************

Contents of hdump.txt (which is the same as output.txt)

*************

HTTP/1.1 302 Found
Date: Wed, 07 Nov 2001 23:48:13 GMT
Server: Apache/1.3.19 (Unix)
Set-Cookie: PHPSESSID=20eff5aa1688379145249393982c59f3; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: No-Cache
Location: /
Content-Type: text/html
Content-Length: 0
Proxy-Connection: close
Age: 0

*************

Cookies.txt

***********

# Netscape HTTP Cookie File
# http://www.netscape.com/newsref/std/cookie_spec.html
# This is generated by libcurl! Edit on your own risk.

(null) FALSE (null) FALSE 0 PHPSESSID 20eff5aa1688379145249393982c59f3

**************

I didn't quite understand your question about incomplete headers - that's what I get when using curl as described.

And yes, it is curl 7.9 - I'll try 7.9.1 if there's Windows binary available (would it make a difference though?..)

Cheers,
Steve

>>> daniel_at_haxx.se 11/07/01 07:13pm >>>
On Wed, 7 Nov 2001, STEVE STEFANOVICH wrote:

> So to get the contents page I try to use
>
> curl -b empty -L -x myproxy:8080 -d
> "username=xxx&password=yyy&submit=Submit"
> http://www.vreme.com/account/login_action.php

[output snipped out]

> like I'm being redirected somewhere but not get anything back?..

If you add a -v flag to that command line, you get to know a lot more on why
and what curl does. Append a -i as well just to get all the header info at
the same time. And if you show such an output to us, we would be able to
guess much more accurately.

I can't really tell what's happening from I've seen so far. It looks weird.

> If it can help, attached is also a headers dump (dumpy.txt, using -D)

They're incomplete. There's only one set of headers there, and that makes a
Location: to the root page, which you were following, weren't you?

> cookies dump (cookiejar.txt, -c).

Is this a curl 7.9? Upgrade to 7.9.1 and you shouldn't see those (null)
things in the cookie jar...

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/ 
-----------------------------------------------------------
This message has been scanned by MailSweeper.
-----------------------------------------------------------
-----------------------------------------------------------
This e-mail is solely for the use of the intended recipient
and may contain information which is confidential or
privileged. Unauthorised use of its contents is prohibited.
If you have received this e-mail in error, please notify 
the sender immediately via e-mail and then delete the 
original e-mail.
-----------------------------------------------------------
Received on 2001-11-08