【问题标题】:Error:Cannot access the calendar you requested错误:无法访问您请求的日历
【发布时间】:2011-09-27 03:19:41
【问题描述】:

当我将我的事件的 xml 文件发布到谷歌的服务器时,有时我会收到下面的 html,我很困惑为什么会这样,但有时没关系。谁能帮帮我?

是连接错误造成的吗?还是令牌无效?还是什么?

<html><head><meta http-equiv="content-type" content="text/html;charset=UTF-8">
<title>Error</title>
<style type="text/css">body {font-family: arial,sans-serif}</style></head>
<body text="#000000" bgcolor="#ffffff"><table border="0" cellpadding="2" cellspacing="0" width="100%"><tr><td rowspan="3" width="1%" nowrap><b><font face="times" size="10"><font color="#0039b6">G</font> <font color="#c41200">o</font> <font color="#f3c518">o</font> <font color="#0039b6">g</font> <font color="#30a72f">l</font> <font color="#c41200">e</font></font>&nbsp;&nbsp;</b></td>
<td>&nbsp;</td></tr>
<tr><td bgcolor="#3366cc"><font face="arial,sans-serif" color="#ffffff"><b>Error</b></font></td></tr>
<tr><td>&nbsp;</td></tr></table>
<blockquote>Cannot access the calendar you requested</blockquote>
<p></p>
<div style="background:#3366cc; width:1px; height:4px"></div></body></html>

【问题讨论】:

    标签: android calendar gdata


    【解决方案1】:

    好吧,我不能说我真的喜欢这个问题的答案,但我遇到了同样的问题,经过一番摸索后找到了答案。

    Google 有自己的会话 ID,可用于此类请求。第一次发出请求时,它会启动会话并为您提供重定向;它还会导致您在上面看到的错误。据我所知,如果您在设置会话 ID 后再次尝试请求,请求将通过。

    换句话说,您必须发送请求并检查 Google 的响应,看看您是否被重定向。如果是,您可以使用a couple of options 获取包含 Google 会话 ID (gsessionid) 的 URL;我选择从响应中解析 Location 标头,它显示了数据应该发布到的 URL。通过发布到该新 URL 再次尝试您的请求(以及任何后续请求),它应该像一个魅力一样工作。到那里只需要一点时间。

    如需了解更多信息,请查看the Google documentation on redirectsthis somewhat related StackOverflow question

    【讨论】:

    • 感谢您的回复...我已经解决了这个问题。
    • 是因为java中的HttpClient..重定向时会丢失所有post数据。
    猜你喜欢
    • 1970-01-01
    • 2020-05-19
    • 2019-04-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-02-11
    • 1970-01-01
    • 2012-10-29
    相关资源
    最近更新 更多