cURL / Mailing Lists / curl-users / Single Mail

curl-users

libcurl for HTTP post returns error 23 (Failed write) always

From: Vasanthi Ramasamy <Vasanthi.Ramasamy_at_citrix.com>
Date: Wed, 13 Oct 2010 13:03:31 -0700

Hi,

Here is my code:

{
   ...........
     char error[CURL_ERROR_SIZE];
        curl_easy_setopt(m_Curl,CURLOPT_ERRORBUFFER,error);
        curl_easy_setopt(m_Curl,CURLOPT_URL, " http://www.postbin.org/......");
      char *data = "name=vasanthi&project=curl";
        curl_easy_setopt(m_Curl,CURLOPT_POSTFIELDS, data);
        CURLcode res;
        res = curl_easy_perform(m_Curl);
        if (res > 0)
                cout (" Failed to post Req " << error << "Returncode" << res);
}

When I do HTTP post, I do see the request in www.postbin.org<http://www.postbin.org> under my bin. But curl returns error 23 always. Not sure what is the issue here. I'm using RedHat 5 linux. I tried setting CURLOPT_POSTFIELDSIZE to the size of my data above. That also didn't help.

Can somebody help me ?

Thanks,
Vasanthi

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-10-13