I have been programming in DELPHI, work with google calendar and I want to delete an event but I have to go bug.
procedure TForm1.Button1Click (Sender: TObject);
var
url: string;
slParam: TStringList;
begin
test: ='';
IdHTTP2.Request.CustomHeaders.Clear;
IdHTTP2.Request.Connection: = 'Keep-Alive';
IdHTTP2.Request.ContentType: = 'application / atom xml';
IdHTTP2.Request.CustomHeaders.Values ['GData-Version']: = '2';
IdHTTP2.Request.CustomHeaders.Values ['Authorization']: = 'GoogleLogin auth =' auth;
IdHTTP2.HandleRedirects: = true;
url: = http://www.google.com/calendar/feeds/u0qtqn2cke6pjppu1vgj5pj8js %40group.calendar.google.com/private/full
slParam: = TStringList.Create;
slParam.LoadFromFile ('udalit.xml');
try
test: = IdHTTP2.Post (url, slParam);
memo1.Lines.Add (test);
except
on E: EIdHTTPProtocolException do
ShowMessage (E.ErrorMessage);
end;
FreeAndNil (slParam);
end;
Here is my xml file I'm trying to send
<?xml version="1.0" encoding="UTF-8" ?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app" xmlns:batch="http://schemas.google.com/gdata/batch" xmlns:gCal="http://schemas.google.com/gCal/2005" 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" />
<entry gd:etag=""FEUDQAdBfSp7JGA6WhJV"">
<batch:id>Delete itemD</batch:id>
<batch:operation type="delete" />
<id>http://www.google.com/calendar/feeds/u0qtqn2cke6pjppu1vgj5pj8js%40group.calendar.google.com/private/full/ihpe431ebmk9pa39dskjilnsko</id>
</entry>
</feed>
will generate an error when sending
[Line 1, Column 227] Invalid root element, expected (http://www.w3.org/2005/Atom:entry), got (http://www.w3.org/2005/Atom:feed)