[Lazarus] Google APIs
Michael Van Canneyt
michael at freepascal.org
Fri May 15 12:02:41 CEST 2015
On Fri, 15 May 2015, markbass72 wrote:
> On 15/05/2015 10:22, Michael Van Canneyt wrote:
>>
>> Better ask questions here. I don't use the forum, I'm old school.
>> But I have answered on the forum.
>>
>
> from forum:
>> you can set the webclient.logfile to some valid filename and examine the
>> resulting
> file after the request. It should contain the complete response of google
>> Note that you better use the Patch method if you're just changing some
>> properties.
>
>
> Following the response for:
> FCalendarAPI.EventsResource.Update(FCurrentCalendar.ID, entry.id, Entry);
>
> that is the same (except for 1st line where response begins with "Request :
> PATCH https://...") for:
> FCalendarAPI.EventsResource.Patch(FCurrentCalendar.ID, entry.id, Entry);
>
> maybe missing headers?
Looks like it, a header 'Content-type: application/javascript' should be added.
Look in googleservice.pp, line 522
Req.SetContentFromString(AInput);
There add a
if (AMethod<>'GET') then
Req.Headers.Add('Content-Type: application/json');
Strange.
I have created a calendar sync app which does both POST and PATCH.
Probably I have forgotten to copy some changes to the FPC repo.
Please test and report, if this helps, I'll update the API.
(I need to do some other changes anyway)
Michael.
More information about the Lazarus
mailing list