cURL / Mailing Lists / curl-library / Single Mail

curl-library

doubt on curl_easy_perform

From: Rajanikanth <rnamburi_at_cisco.com>
Date: Tue, 20 Jul 2010 17:52:38 +0530

Hi,

            Is there any forum exists, to get clarifications on the cURL
function calls?

 

            Actually when I am using the function call 'curl_easy_perform',
at run time it is getting hanged without any response. I concluded it
because I am not getting any return value which I am printing after
execution of the function.

 

                Following is my sample program. (NOTE: There is one other
executable listening a socket at '127.0.0.1:8888' and it just returns what
it received)

 

#include <stdio.h>

#include <curl/curl.h>

int main(void)

{

       CURL *curl;

       CURLcode res;

       struct curl_slist *headerlist=NULL;

       curl = curl_easy_init();

       if(curl)

       {

              curl_easy_setopt(curl, CURLOPT_URL, "http://127.0.0.1:8888");

              

              headerlist = curl_slist_append(headerlist, "Content-Type:
text/html");

 

              curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headerlist);

              /* Now specify the POST data */

              curl_easy_setopt(curl, CURLOPT_POSTFIELDS,
"name=RAJANI\r\nproject=curl\r\n\r\n");

 

              printf("B4 perform\n");

              res = curl_easy_perform(curl);

              if (res == 0)

                     printf("After perform\n");

              else

                     printf("Perform returns = %d\n", res);

 

              curl_easy_cleanup(curl);

       }

return 0;

}

 

Thanks & Regards,

Rajanikanth N.V

+91 89789 33889

 

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-07-20