cURL / Mailing Lists / curl-library / Single Mail

curl-library

libcurl problem

From: Kamieniecki, Darcy <Darcy.Kamieniecki_at_ta-alberta.ca>
Date: Wed, 29 Jan 2003 13:44:56 -0700

I am having troubles using java and libcurl v7.9.5 to get a web page for me.

I can successfully connect to my remote site and download the info.csv page
using the following curl command line:

curl -s --cert pemfile.pem https://www.xxx.yyy.zzz/login.asp -d user=<user>
-d pswd=<password> -d login=Submit https://www.xxx.yyy.zzz/CheckUser.asp
https://www.xxx.yyy.zzz/info.csv

Here's my java code:

                cg.setopt(CurlGlue.CURLOPT_URL,
"https://www.xxx.yyy.zzz/login.asp");
                cg.setopt(CurlGlue.CURLOPT_SSLVERSION, 3);
                cg.setopt(CurlGlue.CURLOPT_VERBOSE, 1);
                cg.setopt(CurlGlue.CURLOPT_FOLLOWLOCATION, 1);
                cg.setopt(CurlGlue.CURLOPT_POST, 1);
                cg.setopt(CurlGlue.CURLOPT_POSTFIELDS,
"name="+name+"&pswd="+password+"&login=Submit");
                cg.setopt(CurlGlue.CURLOPT_SSLCERT, "./pemfile.pem");
                cg.setopt(CurlGlue.CURLOPT_COOKIEJAR, "cookie.txt");
                cg.perform(); // FIRST PAGE - login

                cg.setopt(CurlGlue.CURLOPT_URL,
"https://www.xxx.yyy.zzz/CheckUser.asp");
                //MANUAL SET COOKIE TEST cg.setopt(CurlGlue.CURLOPT_COOKIE,
"ASPSESSIONIDQGGGGHYY=abcdefghijklmnop");
                cg.perform(); // SECOND PAGE - validate user

                cg.setopt(CurlGlue.CURLOPT_URL,
"https://www.xxx.yyy.zzz/info.csv");
                cg.perform(); // THIRD PAGE - get info

--------------------------------------------------------
For whatever reason, it doesn't look like the session id generated by the
first page request is used by the second page request. If I manually set the
session id, it works fine.

I would appreciate any help,
Thanks in advance,
Darcy Kamieniecki

-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
Received on 2003-01-29