cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Strange problem with curl involving cookies and post data

From: Pieter Steyn <pieterste_at_gmail.com>
Date: Thu, 5 Mar 2009 14:53:25 +0200

Hi,

Ok, I needed to use the -L switch too, to follow the redirect.

But, end of the day I had the exact same problem as with wget. The
ajax doesn't get dealt with properly and I end up with an empty div,
where it's filled if I had used a browser.

Sigh. Oh well.

Thanks anyway guys,
Pieter

On Thu, Mar 5, 2009 at 2:36 PM, Pieter Steyn <pieterste_at_gmail.com> wrote:
> Hi guys,
>
> Could someone please tell me whats wrong with this:
>
> I run it, and get no output at all, and the exit code is 0 ..but the
> wget one gives me output:
>
> curl -E usercert.pem:$PASS --key userkey.pem --pass 1234 --insecure -b
> curlcookies.txt --data 'circuitNumber=number'
> https://www.site.com/blah/blah.do
>
> wget  --private-key=userkey.pem --certificate=usercert.pem
> --no-check-certificate --load-cookies cookies.txt --post-data
> 'circuitNumber=number' https://www.site.com/blah/blah.do
>
> I need to use curl for this, because wget doesn't support ajax at all
> and thus I don't get complete results in the html thats supposed to
> return.
>
> Here is the curlcookies.txt and the cookies.txt (which I use for wget
> and works):
>
> cookies.txt:
> # HTTP cookie file.
> # Generated by Wget on 2009-03-05 12:47:14.
> # Edit at your own risk.
>
> www.site.com        FALSE   /cas    TRUE    0       CASTGC  blahblahblah
>
> curlcookies.txt:
>  Netscape HTTP Cookie File
> # http://curl.haxx.se/rfc/cookie_spec.html
> # This file was generated by libcurl! Edit at your own risk.
>
> www.site.com        FALSE   /cas    TRUE    0       CASTGC  blahblahblah
> www.site.com       FALSE   /cas    TRUE    10      userName
> www.site.com        FALSE   /cas    TRUE    10      password
> www.site.com        FALSE   /cas    TRUE    10      localUser
>
> I don't understand why the wget one gives me output (although
> incomplete because of the ajax, but the curl one gives me nothing.)
>
> Hopefuly it's just a syntax / missing switch.
>
> Oh, last bit of information, running the curl command with -v
>
> This is interesting, but I'm not sure why it's happening:
>
>> Host: www.site.com
>> Accept: */*
>> Content-Length: 24
>> Content-Type: application/x-www-form-urlencoded
>>
> < HTTP/1.1 302 Moved Temporarily
> < Date: Thu, 05 Mar 2009 12:21:49 GMT
> < Server: Apache
> * Added cookie JSESSIONID="blahblah" for domain www.unibase.info, path
> /uniweb, expire 0
> < Set-Cookie: JSESSIONID=blahblah; Path=/blah; Secure
> < Location: https://www.site.com/blah/?ticket=blahblah
> < Content-Length: 0
> < Content-Type: text/plain
> <
> * Connection #0 to host www.blah.com left intact
> * Closing connection #0
>
>
> Thanks,
> Pieter
>
-------------------------------------------------------------------
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 2009-03-05