Evenement Google Calendars en Delphi
Bonjour je suis connecté au Google Calendars je sais lire les évènements ainsi que les calendriers je cherche le moyen de rajouter un évènement. Voici le code
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| var
postStrings: TidStringList;
sUrl,PostResult : String;
slParam : TStringList;
mStream : TMemoryStream;
begin
idHttp1.Request.ContentType := 'application/atom+xml';
surl := 'http://www.google.com/calendar/feeds/default/private/full';
slParam := TStringList.Create;
mStream := TMemoryStream.Create;
slParam.LoadFromFile('NewCal.xml');//Je charge le fichier XML
IdHTTP1.HandleRedirects := True;
postResult := idHttp1.Post(surl, slPAram);
Memo1.Lines.Clear;
Memo1.Lines.Add(postResult);
end; |
voici le fichier XML que j'envoie
Code:
1 2 3 4 5 6 7 8 9
| <entry xmlns="http://www.w3.org/2005/Atom" xmlns:gd="http://schemas.google.com/g/2005">
<category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/g/2005#event"/>
<title type="text">Tennis with Beth</title>
<content type="text">Meet for a quick lesson.</content>
<gd:transparency value="http://schemas.google.com/g/2005#event.opaque"/>
<gd:eventStatus value="http://schemas.google.com/g/2005#event.confirmed"/>
<gd:where valueString="Rolling Lawn Courts"/>
<gd:when startTime="2006-04-17T15:00:00.000Z" endTime="2006-04-17T17:00:00.000Z"/>
</entry> |
en réponse j'ai un BAD Request. J'utilise un sniffer qui me dit qu'en apparence j'ai une erreur de format de fichier. Sauriez-vous m'aider merci