cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Help !!! (Posting Data to Server)

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 1 Nov 2001 15:19:10 +0100 (MET)

On Thu, 1 Nov 2001, Shailesh Mittal wrote:

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

> 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);

Two things:

 1 - Are you sure CURLOPT_HTTPPOST is the option you want? CURLOPT_POSTFIELDS
     is a lot more commonly used... I'm afraid the java code you presented
     doesn't give me more to go on either (as far as guessing which POST
     method it is that you really want).

 2 - curl_formadd() has some rather unpleasent bugs in libcurl 7.9. If you
     want this functionality, I offer these three alternatives:
     a) wait until the 7.9.1 public release
     b) get a 7.9.1 pre-release
     c) use curl_formparse() until a) is avaiable

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
Received on 2001-11-01