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
评论列表
文章目录