cURL / Mailing Lists / curl-library / Single Mail

curl-library

java HTTPPOST

From: s.e.t.i. <setigamer_at_gmail.com>
Date: Thu, 20 Jan 2005 08:24:21 -0800

The java binding of libcurl does not support CURL.OPT_HTTPPOST. You
must use CURL.OPT_POST ("Content-Type:
application/x-www-form-urlencoded") until I get a native function
implemented to handle multipart/formdata posts. curl_formfree is
called in the process of using HTTPPOST and causes an access violation
in javacurl.dll (which is libcurl.dll compiled with the java native
code) on the Windows 2K/XP platform.

The following code in the java binding of libcurl:

        cg.setopt(CURL.OPT_URL, "https://www.somedomain.org/loginpost.htm");
        cg.setopt(CURL.OPT_POSTFIELDS, "postfield=XXXX");
        cg.setopt(CURL.OPT_HTTPPOST, 1); // note this is the
multipart/form version of POST
        cg.perform();

Generates the following error:

An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred
at PC=0x1838605D
Function=curl_formfree+0x24A
Library=C:\eclipse3\eclipse\plugins\org.curl_1.0.0\os\win32\x86\javacurl.dll

Current Java thread:
        at org.curl.CurlGlue.jni_perform(Native Method)
        - locked <0x1005c908> (a org.curl.CurlGlue)
        at org.curl.CurlGlue.perform(CurlGlue.java:78)

-- 
Cheers... s.e.t.i.
Received on 2005-01-20