我无法在 google 中创建事件,我在运行代码时使用的是同一网站中的 google 手册
CreateXML : = TStringList.Create ;
CreateXML.Add (
' <? xml version = encoding = '' 1.0'' '' UTF- 8'' > ' # 13 # 10 +
'< entry xmlns ='' '' ttp://www.w3.org/2005/Atom ' # 13 # 10 +
' xmlns: gd = ttp://schemas.google.com/g/2005 '' ''> ' # 13 # 10 +
'< category scheme = '' '' ttp://schemas.google.com/g/2005 # kind ' # 13 # 10 +
' ttp://schemas.google.com/g/2005 # term = '' event ''> < / category> ' # 13 # 10 +
' <title> type=''text''> ' + title + ' < / title> ' # 13 # 10 +
' <content type=''text''> ' + content + ' < / content> ' # 13 # 10 +
'< gd : transparency ' # 13 # 10 +
' ttp://schemas.google.com/g/2005 # value = '' '' event.opaque >' # 13 # 10 +
'< / gd : transparency >' # 13 # 10 +
'< gd : eventStatus ' # 13 # 10 +
' ttp://schemas.google.com/g/2005 # value = '' '' event.confirmed >' # 13 # 10 +
'< / gd : eventStatus >' # 13 # 10 +
' <gd:where '''> valueString=''' + location + < / gd : where >' # 13 # 10 +
'< gd : when startTime = ''' + '''' + EventStartTime # 13 # 10 +
' endTime ='' ' + eventEndTime + '' ' > < / gd : when> ' # 13 # 10 +
'< / entry> ');
slPost : = TStringList.Create ;
slReply : = TStringList.Create ;
slPost.Values [' accountType '] : = ' HOSTED_OR_GOOGLE ';
slPost.Values [' email ' ] = email ;
slPost.Values [' Passwd ' ] = pass ;
slPost.Values [' service' ] : = ' cl ';
slPost.Values [' source' ] = '123 ';
idHTTP1.IOHandler : = IdSSLIOHandlerSocketOpenSSL1 ;
idHTTP1.Request.ContentType : = ' application / x -www -form- urlencoded ';
Responsetxt : = idHTTP1.Post ( ' https://www.google.com/accounts/ClientLogin ' SlPost ) ;
slReply.Delimiter : = # 10;
slReply.DelimitedText : = Responsetxt ;
FAuthID : = slReply.Values [' Auth '] ;
if Length ( FAuthID ) > 0 then
Begin
try
URL : = ' https://www.google.com/calendar/feeds/ ' + NormalizeField (email) + '/ private / full ';
idHTTP2.IOHandler : = IdSSLIOHandlerSocketOpenSSL1 ;
IdHTTP2.Request.Connection : = ' Keep- Alive ';
idHTTP2.Request.ContentType : = ' application / atom + xml' ;
idHTTP2.Request.CustomHeaders.Values [' GData - Version' ] = '2 .0 ' ;
idHTTP2.Request.CustomHeaders.Values [ 'Authorization' ] = (' GoogleLogin Auth =' + FAuthID );
try
Responsetxt : = idHTTP2.Post (URL , CreateXML );
except
on E: EIdHTTPProtocolException do
begin
响应是 IdHTTP2 的文本
答案在标题中,但 GsessionID http:/302 变量没有出现,所以我不能将它添加到标题中,只出现 idhttp 变量:SecureLocation 和变量 T
请我希望你能帮我解决这个问题
非常感谢您的宝贵时间。
我们谷歌翻译