cURL / Mailing Lists / curl-users / Single Mail


RE: I can't post data to a url

From: Schneider John <>
Date: Mon, 6 Jun 2005 07:33:24 -0500

You can set it to whatever you know to be valid if you wish:

   struct curl_slist *curlHeader = NULL;
   curlHeader = curl_slist_append(curlHeader, "Content-Type: xxxxxxx");
   curl_easy_setopt(curlHandle, CURLOPT_HTTPHEADER, curlHeader);

(replace xxxxxxx with whatever works)
 - John

-----Original Message-----
[] On Behalf Of kl rao
Sent: Saturday, June 04, 2005 5:16 AM
Subject: I can't post data to a url

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
     curls = curl_easy_init();
     if(curls) {
                 curl_easy_setopt(curls, CURLOPT_HTTPAUTH,
                 curl_easy_setopt(curls, CURLOPT_POSTFIELDS,postthis);

                 curl_easy_setopt(curls, CURLOPT_URL,
         res = curl_easy_perform(curls);
     return 0;
 thanks & regards,

How much free photo storage do you get? Store your friends 'n family
snaps for FREE with Yahoo! Photos

How much free photo storage do you get? Store your friends 'n family
snaps for FREE with Yahoo! Photos

This e-mail is confidential. If you are not the intended recipient, you must not disclose or use the information contained in it. If you have received this e-mail in error, please tell us immediately by return e-mail to and delete the document.

E-mails containing unprofessional, discourteous or offensive remarks violate Sentry policy. You may report employee violations by forwarding the message to

No recipient may use the information in this e-mail in violation of any civil or criminal statute. Sentry disclaims all liability for any unauthorized uses of this e-mail or its contents.

This e-mail constitutes neither an offer nor an acceptance of any offer. No contract may be entered into by a Sentry employee without express approval from an authorized Sentry manager.

Warning: Computer viruses can be transmitted via e-mail. Sentry accepts no liability or responsibility for any damage caused by any virus transmitted with this e-mail.
Received on 2005-06-06