【问题标题】:Facebook apprequest [duplicate]Facebook apprequest [重复]
【发布时间】:2012-02-19 04:19:24
【问题描述】:

可能重复:
Tornado Framework (FacebookGraphMixin)

我正在尝试使用 Tornado 框架构建一个 apprequest。问题是我不允许使用 tornado.web.RequestHandler。这意味着我不能使用 async_callback() 函数。有没有办法解决这个问题?谢谢。

首先:(使用 tornado.web.RequestHandler)

class mainH(tornado.web.RequestHandler, tornado.auth.FacebookGraphMixin):
    def get(self):
        self.facebook_request(
            "/"+player_id+"/apprequests",
            post_args={"message": "I am an app request!"},
            access_token=app_access_token,
            callback=self.async_callback(self._on_post))

第二个:(去掉tornado.web.RequestHandler)

class mainH(tornado.auth.FacebookGraphMixin):
    def get(self):
        self.facebook_request(
            "/"+player_id+"/apprequests",
            post_args={"message": "I am an app request!"},
            access_token=app_access_token,
            callback=self.async_callback(self._on_post)) # can't use this line!

【问题讨论】:

    标签: python facebook request tornado


    【解决方案1】:

    如果您不能使用tornado.web.RequestHandler,那么您将无法使用需要它的库,例如tornado.auth。 “不允许”有点奇怪;我会挑战这个要求。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-11-13
      • 1970-01-01
      相关资源
      最近更新 更多