HTTP 302 - 未找到参数GSessionID - Google日历

时间:2014-04-30 22:03:27

标签: delphi google-calendar-api gdata delphi-xe4 idhttp

我需要帮助。

我希望在发送参数时,使用桌面应用程序在Google日历上创建活动 url =' https://www.google.com/calendar/feeds/emaill%40gmail.com/private/full&#39 ;; 然后在创建此事件的位置添加xml

createXML := '<?xml version=''1.0'' encoding=''UTF-8''?>'#13#10 +
                  '<entry xmlns=''http://www.w3.org/2005/Atom'''#13#10 +
                  'xmlns:gd=''http://schemas.google.com/g/2005''>'#13#10 +
                  '<category scheme=''http://schemas.google.com/g/2005#kind'''#13#10 +
                  'term=''http://schemas.google.com/g/2005#event''></category>'#13#10 +
                  '<title type=''text''>' + title + '</title>'#13#10 +
                  '<content type=''text''>' + content + '</content>'#13#10 +
                  '<gd:transparency'#13#10 +
                  'value=''http://schemas.google.com/g/2005#event.opaque''>'#13#10 +
                  '</gd:transparency>'#13#10 +
                  '<gd:eventStatus'#13#10 +
                  'value=''http://schemas.google.com/g/2005#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>';

当我执行POST过程时,会出现下一个标题

HTTP/1.0 302 Moved Temporarily
Expires: Wed, 30 April 2014 17:37:17 GMT
Date: Wed, 30 April 2014 17:37:17 GMT
Set- Cookie: T=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx;
Expires = Tue, 13 -May- 2014 10:32:28 GMT;
SecureLocation : https://www.google.com:443/calendar/feeds/default/private/full?t=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Content- Type: text / html ; charset = UTF -8
Cache- Control: private , max -age = 0
X -Content -Type -Options : nosniff
X -Frame -Options : SAMEORIGIN
X -XSS -Protection : 1; mode = block
Server : GSE
Alternate -Protocol : 443: quic

在手册中,Google列出了我需要一个名为&#34的变量; GSessionID&#34;但是在我看来不是, 我会帮助我解决这个问题。 我有两个带身份验证的项目:ClientLogin和OAuth 2.0 因为我得到这个参数? 非常感谢。

我们谷歌翻译

1 个答案:

答案 0 :(得分:0)

它必须工作才能检索新加载的gsessionID条件两次实现post过程,异常中的第二个

  try
  idHTTP2.Post(URL,XML);
  except on E: EIdHTTPProtocolException do
    idHTTP2.Post(URL,XML);
  end;

感谢您的时间。