错误:无法访问您请求的日历

发布于 2024-11-30 00:16:27 字数 1343 浏览 3 评论 0原文

当我将事件的 xml 文件发布到 google 的服务器时,有时我会收到下面的 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>

When I post my events' xml file to google's server , sometimes I will receive the html below , I am very confused why it happens ,but sometimes it is OK. Any one can help me?

Is it caused by the connection error? or the token is invalid ? or what?

<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>  </b></td>
<td> </td></tr>
<tr><td bgcolor="#3366cc"><font face="arial,sans-serif" color="#ffffff"><b>Error</b></font></td></tr>
<tr><td> </td></tr></table>
<blockquote>Cannot access the calendar you requested</blockquote>
<p></p>
<div style="background:#3366cc; width:1px; height:4px"></div></body></html>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

潇烟暮雨 2024-12-07 00:16:27

好吧,我不能说我真的喜欢这个问题的答案,但我遇到了同样的问题,并在一番欺骗后找到了答案。

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

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

有关详细信息,请查看有关重定向的 Google 文档和< a href="https://stackoverflow.com/questions/1949171/possible-to-request-gsessionid-without-a-302-response">这有点相关的StackOverflow问题。

Well, I can't say I really like the answer to this question, but I was having the same issue and found an answer after a bit of finagling.

Google has its own session ID that it uses for these kinds of requests. The first time you make a request, it starts the session and gives you a redirect; it also causes the error you saw above. From what I can gather, if you try the request again after the session ID has been set, the request will go through.

In other words, you have to send the request and check the response from Google to see if you're being redirected. If you are, you have a couple of options to grab the URL that has Google's session ID (gsessionid) included; I chose to parse the Location header out of the response, which shows the URL to which the data should be posted. Try your request again (and any subsequent requests) by posting to that new URL, and it should work like a charm. Just takes a bit to get there.

For more info about this, check the Google documentation on redirects and this somewhat related StackOverflow question.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文