cURL / Mailing Lists / curl-library / Single Mail

curl-library

Help !!! (Posting Data to Server)

From: Shailesh Mittal <smmittal_at_yahoo.com>
Date: Thu, 1 Nov 2001 21:03:57 -0500

I started using the libcurl lib recently and finding problems in POSTing the data from (Client: In VisualC++) to (Server : In Java).

Problem Details:

On the client I am using the following function (also as described in one of the sample) to post the data
    curl_formadd(&formpost,
                 &lastptr,
                 CURLFORM_COPYNAME, "8000.000", /*The ParameterName=8000.000 and Value=Data for 8000*/
                 CURLFORM_FILE, "Data for 8000",
                 CURLFORM_END);

    curl_formadd(&formpost,
                 &lastptr,
                 CURLFORM_COPYNAME, "9000.000", /*The ParameterName=9000.000 and Value=Data for 9000*/
                 CURLFORM_COPYCONTENTS, "Data for 9000",
                 CURLFORM_END);

---
---
      curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost);
      res = curl_easy_perform(curl);
On the server in Java, I do the following
        java.util.Enumeration enum = request.getParameterNames();
        while (enum.hasMoreElements())   {
               sFieldId = (String) enum.nextElement();
               sData = request.getParameter (sFieldId);
               system.println ("csFieldId=" + sFieldId + ",Value=" + sData);
        }
I don't get anything, please let me know.
Thanks in advance.
Shailesh
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
Received on 2001-11-01