作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
当我将我的 Activity 的 xml 文件发布到 google 的服务器时,有时我会收到下面的 html,我很困惑为什么会这样,但有时是可以的。谁能帮帮我?
是连接错误导致的吗?或者 token 无效?或者什么?
<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>
最佳答案
好吧,我不能说我真的喜欢这个问题的答案,但我遇到了同样的问题,经过一番折腾后找到了答案。
Google 有自己的 session ID,可用于此类请求。第一次发出请求时,它会启动 session 并为您提供重定向;它还会导致您在上面看到的错误。据我所知,如果您在设置 session ID 后再次尝试请求,请求将会通过。
换句话说,您必须发送请求并检查 Google 的响应以查看您是否被重定向。如果你是,你有a couple of options获取包含 Google session ID (gsessionid) 的 URL;我选择从响应中解析 Location header ,它显示数据应发布到的 URL。通过发布到该新 URL 再次尝试您的请求(以及任何后续请求),它应该非常有效。只需一点时间即可到达。
有关此的更多信息,请查看 the Google documentation on redirects和 this somewhat related StackOverflow question .
关于android - 错误 :Cannot access the calendar you requested,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7089210/
我是一名优秀的程序员,十分优秀!