cURL / Mailing Lists / curl-users / Single Mail


Re: Plz help me posting data to a url

From: Ralph Mitchell <>
Date: Wed, 8 Jun 2005 02:08:40 -0500

On 6/8/05, Daniel Stenberg <> wrote:
> On Wed, 8 Jun 2005, kl rao wrote:
> > curl_easy_setopt(curls,
> > curl_easy_setopt(curls,
> The second call will override what you set in the previous one. You can only

Also, you haven't set any POST variables. When you do this:

   strcpy(txt,"this is test");

the equivalent curl command line would look like this:

     curl -d "this is test" http://.........

Now, if you to do this instead:

     strcpy(txt,"txt=this is test");

that would be the same as:

     curl -d txt="this is a test" http://......

and the server would be given a POST variable called txt with the
specified content. And you should encode the spaces too:

     strcpy (txt, "txt=this%20is%20a%20%20text&mob=919849339091");

assuming "txt" and "mob" are the variable names that the server is expecting.

Ralph Mitchell
Received on 2005-06-08