可能请求gsessionid未经302响应 [英] Possible to request gsessionid without a 302 response

查看:267
本文介绍了可能请求gsessionid未经302响应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在写一个谷歌gdata的API客户端在Flash / AS2(可悲的是,转移到AS3是不是在这个时候一个选项)。通过ClientLogin用户登录工作正常,但subquent请求将返回302重定向,其中包括一个gsessionid我应该包括与未来的要求,以避免302S。

I'm writing a google gdata API client in Flash/AS2 (sadly, moving to AS3 is not an option at this time). Logging in via ClientLogin works fine but subquent requests will return a 302 redirect that includes a gsessionid I am supposed to include with future requests to avoid the 302s.

闪存/ AS2,AFAIK,不允许我真正查询HTTP错误响应主体以任何方式,所以没有办法让我真切​​地看到这gsessionid 302返回后。是否有一个gdata的API调用,这将返回我的一个有效gsessionid内的HTTP 200响应,如果我已经有一个有效的GoogleLogin身份验证令牌,或者是这不可能没有一个人在这方面的中间人代理?

Flash/AS2, AFAIK, does not allow me to actually query an http error response body in any way, so there's no way for me to actually see this gsessionid after the 302 is returned. Is there a gdata api call which will return me a valid gsessionid inside an HTTP 200 response if I already have a valid GoogleLogin auth token, or is this not possible without a man-in-the-middle proxy?

推荐答案

唯一的谷歌数据API应该返回一个gsessionid是日历数据API。没有其他的做到这一点,据我所知。

The only Google Data API that should return a gsessionid is the Calendar Data API. None of the others do this, to my knowledge.

话虽这么说,在一般情况有选择这里:

That being said, in general there's options here:

  1. 从刮重定向身体,这听起来像你试过gsessionid查询参数。 (在一般情况下,这是脆弱的,不是一个好主意。)
  2. 使用位于重定向的位置gsessionid查询参数:
  3. 重定向也将包含一个 S = 的cookie。如果你能确保该cookie获取未来的要求设置,谷歌日历将使用它来代替一个gsessionid查询参数。
  1. Scrape the gsessionid query parameter from the redirect body, which it sounds like you tried. (In general, this is fragile and not a good idea.)
  2. Use the gsessionid query parameter located within the redirect's Location: header.
  3. The redirect will also contain an S= cookie. If you can make sure this cookie gets set for future requests, Google Calendar will use it in place of a gsessionid query parameter.

如果没有这些会为你工作,你唯一的选择就是写一个代理。有没有办法让gsessionid重定向之外,没有它的日历数据API不会请求提供服务。

If neither of these will work for you, your only option is to write a proxy. There's no way to get the gsessionid outside of the redirect, and the Calendar Data API won't serve requests without it.

这篇关于可能请求gsessionid未经302响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆