fb_api.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:dancedeets-monorepo 作者: mikelambert 项目源码 文件源码
def _create_rpc_for_batch(self, batch_list, use_access_token):
        post_args = {'batch': json.dumps(batch_list)}
        token = self.random_access_token()
        if use_access_token and token:
            post_args["access_token"] = token
        else:
            post_args["access_token"] = '%s|%s' % (facebook.FACEBOOK_CONFIG['app_id'], facebook.FACEBOOK_CONFIG['secret_key'])
        post_args["include_headers"] = False  # Don't need to see all the caching headers per response
        post_data = None if post_args is None else urls.urlencode(post_args)
        rpc = urlfetch.create_rpc(deadline=DEADLINE)
        urlfetch.make_fetch_call(rpc, "https://graph.facebook.com/", post_data, "POST")
        self.fb_fetches += len(batch_list)
        return rpc, token
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号