cURL / Mailing Lists / curl-library / Single Mail

curl-library

Fwd: libcurl HTTP header: is curl_slist_append enough - solved!?

From: Adenilson Cavalcanti <savagobr_at_yahoo.com>
Date: Tue, 6 May 2008 19:04:31 -0700 (PDT)

Daniel Stenberg

Thanks a lot for the comments! I was using correctly the libcurl (even if I was a little afraid of misusing it since this is my first time).

The problem was in the Authentication string added in the header (I forgot to remove '\r\n\' in the end of that string), not related at all with libcurl.

Fortunately, I good friend spotted my error and provided me a fix for it.

Anyway, thanks a lot for developing libcurl. Its a solid, well documented and fun to use network library for us C programmers.

Best regards

Adenilson

       
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.

attached mail follows:


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-07