cURL / Mailing Lists / curl-users / Single Mail

curl-users

I can't post data to a url

From: kl rao <rklrao_at_yahoo.co.in>
Date: Sat, 4 Jun 2005 11:15:30 +0100 (BST)

Hi everybody,
 
     
     I am new to use curl library. I have written some
 code in 'C' to post data to a url. The program
 responding with error 'Invalid Content-Type'. Plz
 check out this code.. and suggest me changes..

 code here:
 
----------------------------------------------------------------------------------------------
 #include <stdio.h>
 #include <curl/curl.h>
 
   int main(void)
   {
     CURL *curls;
     CURLcode res;
 
     char *postthis="to=919849339091&text=test
 message";
 
     curls = curl_easy_init();
     if(curls) {
                 curl_easy_setopt(curls,
 CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
                 curl_easy_setopt(curls,
 CURLOPT_POSTFIELDS,postthis);
                

curl_easy_setopt(curls,CURLOPT_USERPWD,"tester:foobar");
                 curl_easy_setopt(curls, CURLOPT_URL,
 "http://127.0.0.1:13013/cgi-bin/sendsms");
 
         res = curl_easy_perform(curls);
 
       curl_easy_cleanup(curls);
     }
     return 0;
   }
 
 
----------------------------------------------------------------------------------------------
 
 thanks & regards,
 R.K.L.Rao.

                
__________________________________________________________
How much free photo storage do you get? Store your
friends 'n family snaps for FREE with Yahoo! Photos http://in.photos.yahoo.com

                
__________________________________________________________
How much free photo storage do you get? Store your friends 'n family snaps for FREE with Yahoo! Photos http://in.photos.yahoo.com
Received on 2005-06-05