cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curlpp mailing list Archives

[cURLpp] I can't post data to an url

From: kl rao <rklrao_at_yahoo.co.in>
Date: Sat, 4 Jun 2005 10:54:24 +0100 (BST)

Hi,

    
    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.

                
_______________________________________________________
Too much spam in your inbox? Yahoo! Mail gives you the
best spam protection for FREE! http://in.mail.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
_______________________________________________
cURLpp mailing list
cURLpp_at_rrette.com
http://www.rrette.com/mailman/listinfo/curlpp
Received on 2005-06-04

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET