cURL / Mailing Lists / curl-library / Single Mail


libcurl HTTP header: is curl_slist_append enough?

From: Adenilson Cavalcanti <>
Date: Tue, 6 May 2008 13:19:40 -0700 (PDT)
libcurl HTTP header: is curl_slist_append enough?

Dear friends

First off, libcurl is a really easy to use and well designed
library. The sample source code provided together with the library is
of great help to learn how to code using libcurl.

I'm using libcurl in a pet project named libgcal, an ANSI C library to
edit/retrieve/delete google calendar events.

You can see an example of use here:
and access the git repository here:
and further details here:

I got stuck when implementing 'add new entry' operation. Googling
around returned that one possible error source could be the HTTP
header used when making the request ('application/x-www-form-urlencoded') while it should be set to 'application/atom+xml').

I used 'curl_slist' and 'curl_slist_append' to set it accordingly
(file gcal.c:http_post in line 221).;f=src/gcal.c;h=d7776019aa5fcdbaa57ed355fccdfa5779380de0;hb=HEAD

My question is if there is a way to see if the *sent* HTTP header is
really correct? Do I need to use any other libcurl function to set the

Best regards


Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.
Received on 2008-05-06