【问题标题】:python gdata "too many redirects from server: 302"python gdata“来自服务器的重定向太多:302”
【发布时间】:2012-08-23 11:01:23
【问题描述】:

我有这个代码...

while (True):

    try:
        feed_entry = cal_client.GetCalendarEventFeed(process_steps_dev_cal_link).entry
        feed_entry2 = cal_client.GetCalendarEventFeed(backup_steps_dev_cal_link).entry
        break
    except gdata.client.RedirectError, e:
        print e

我正在从我的 cal_client 登录中获取两个日历链接。 但是,RedirectError 一直像这样显示...

Too many redirects from server: 302, <HTML>
<HEAD>
<TITLE>Moved Temporarily</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>Moved Temporarily</H1>
The document has moved <A HREF="https://www.google.com/calendar/feeds/"myemail"/private/full?gsessionid=2jV2trFEab1MHFHbjnGU4Q">here</A>.
</BODY>
</HTML>

这是什么原因?直到今天一切正常。此外,它不会每次都这样做。有时有效,有时无效。但大多不是。

【问题讨论】:

    标签: python redirect google-calendar-api gdata-api http-status-code-302


    【解决方案1】:

    这里有问题:

    <A HREF="https://www.google.com/calendar/feeds/"myemail"/private/full?gsessionid=2jV2trFEab1MHFHbjnGU4Q">
    

    链接本身有一个指向https://www.google.com/calendar/feeds/ 的HREF,因为"myemail" 是链接的一部分,这可能会导致重定向。检查您传递给cal_client.GetCalendarEventFeed() 的链接并确保它们的格式正确。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-11-22
      • 2017-04-12
      • 1970-01-01
      • 2013-09-21
      • 2023-03-25
      • 1970-01-01
      • 2015-02-16
      • 2020-07-02
      相关资源
      最近更新 更多