J'utilise libcurl avec PHP pour récupérer le flux atom de mon agenda
google.
- Pour ce qui est de la l'authentification c'est OK.
- Pour la récupération de la liste des agendas disponibles sur mon
compte c'est aussi OK.
- Par contre, j'ai un petit problème pour ajouter un événement (POST
http://www.google.com/calendar/feeds/default/private/full ) en
utilisant la doc disponible sur
http://code.google.com/intl/fr/apis/calendar/docs/2.0/developers_guide_protocol.html#Auth.
En fait j'ai systématiquement le message suivant:

Length Required
POST requests require a Content-length header.

Voici le code curl avec l'entête
$header = array();
$header[] = "Host: localhost";
$header[] = "MIME-Version: 1.0";
$header[] = "Accept: text/xml;";
$header[] = "Authorization: GoogleLogin auth=".$hasil[1]; //
AuthUserToken
//$header[] = "Content-length: ".strlen($_entry);
$header[] = "Content-type: application/atom+xml";
$header[] = "Cache-Control: no-cache";
$header[] = "Transfer-Encoding: Chunked";
$header[] = "Connection: close \r\n";
$header[] = $_entry;

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"https://www.google.com/calendar/feeds/
default/private/full");
curl_setopt($ch,CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch,CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch,CURLOPT_REFERER, "http://google.com";);
curl_setopt($ch,CURLOPT_VERBOSE, true);
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch,CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch,CURLOPT_HEADER, true);
curl_setopt($ch,CURLOPT_NOBODY, false);
curl_setopt($ch,CURLOPT_COOKIEJAR, $fCookieFile);
curl_setopt($ch,CURLOPT_COOKIEFILE, $fCookieFile);
curl_setopt($ch,CURLOPT_POST, 1);
curl_setopt($ch,CURLOPT_POSTFIELDS, $post_data);
curl_setopt($ch,CURLOPT_CUSTOMREQUEST,'POST');
curl_setopt($ch,CURLOPT_HTTPHEADER, $header);

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Calendar Data API" group.
To post to this group, send email to 
google-calendar-help-dataapi@googlegroups.com
To unsubscribe from this group, send email to 
google-calendar-help-dataapi+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-calendar-help-dataapi?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to