curl-library
libcurl HTTP header: is curl_slist_append enough?
Date: Tue, 6 May 2008 13:19:40 -0700 (PDT)
curl-library_at_cool.haxx.se
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: http://pastebin.com/m2654d0c6
and access the git repository here: http://repo.or.cz/w/libgcal.git
and further details here:
http://groups.google.com/group/google-calendar-help-dataapi/browse_thread/thread/b0bd9804ab68a6e5
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').
http://groups.google.com/group/google-calendar-help-dataapi/browse_thread/thread/9bc10fd65180c410
I used 'curl_slist' and 'curl_slist_append' to set it accordingly
(file gcal.c:http_post in line 221).
http://repo.or.cz/w/libgcal.git?a=blob;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
header?
Best regards
Adenilson
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.
Received on 2008-05-06