cURL / Mailing Lists / curl-users / Single Mail

curl-users

Java Binding libCurl HTTPPost Struct

From: Brett G. Dymond <bdymond_at_unlv.nevada.edu>
Date: Thu, 15 Nov 2007 00:39:04 -0800

Hi, I am having problems using the java binding of LibCurl.

I am confused as to how to send a simple post with a could form inputs.

I tried making java version of httpPost struct:

 class HttpPost {
        public HttpPost first = null;
        public HttpPost last = null;
        public String name;
        public String content;
 }

then doing something like:

HttpPost account = new HttpPost(); //default constructor to suppress
                                   //intialization errors
account.name = "AccountName";
account.content = "billing";
account.first = account;
account.last = account;

setopt(CURL.OPT_HTTPPOST, account); //does not work, expecting an int

There isn't any documentation for:

public int formadd(int form_opt_copyname, String name,
                                           int form_opt_file, String file,
                                           int form_opt_type, String type);

consequently I am dead in the water.

I have resorted to invoking curl.exe, how do I properly use the formadd() in the
java binding of libcurl?

Thanks,

BD

-- 
Received on 2007-11-15