Facebook graph api 是否不允许使用每请求访问令牌对FQL进行批处理查询?它不是';行不通

Facebook graph api 是否不允许使用每请求访问令牌对FQL进行批处理查询?它不是';行不通,facebook-graph-api,facebook-fql,fql.multiquery,facebook-batch-request,Facebook Graph Api,Facebook Fql,Fql.multiquery,Facebook Batch Request,无法使用多址令牌使用“method/fql.query?query=…”批查询图形吗 我在过去使用多个访问令牌批量查询非fql端点时从未遇到过问题,但在批量查询fql调用时,只有第一个调用返回数据,其余调用返回空正文 我唯一能做的猜测是,它与访问令牌有关,但如果是这样的话,我不知该如何补救 例如: import json from pyfaceb import * user1_tk = '...' #valid token (tested) user1_qry = '...' #valid q

无法使用多址令牌使用“method/fql.query?query=…”批查询图形吗

我在过去使用多个访问令牌批量查询非fql端点时从未遇到过问题,但在批量查询fql调用时,只有第一个调用返回数据,其余调用返回空正文

我唯一能做的猜测是,它与访问令牌有关,但如果是这样的话,我不知该如何补救

例如:

import json
from pyfaceb import *

user1_tk = '...' #valid token (tested)
user1_qry = '...' #valid query (tested unbatched)
user1_rqst = {'method': 'POST', 'relative_url': 'method/fql.query?query=' + user1_qry, 'access_token': user1_tk}

user2_tk = '...' #valid token (tested)
user2_qry = '...' #valid query (tested unbatched)
user2_rqst = {'method': 'POST', 'relative_url': 'method/fql.query?query=' + user2_qry, 'access_token': user2_tk}

batches = [user1_rqst, user2_rqst]

fbg = FBGraph(user1_tk) # use user1_tk as fallback access token (cuz you have to specify one)
data = fbg.get_batch(batches)

print data[0]['body'] #comes back with data, but
print data[1]['body'] #comes back as an empty array.
数据[0]['code']和数据[1]['code']都是HTTP 200响应


如果我将回退访问令牌更改为user2_tk,那么数据[0]['body']将作为空数组返回(即反之亦然)。尽管我为每个请求指定了访问令牌(per:)

但我还是找到了答案。ACCESS_令牌需要位于请求正文中,因为它是一个POST:

...
user1_rqst = {
    'method': 'POST',
    'relative_url': 'method/fql.query?query=' + user1_qry,
    'body': 'access_token=' + user1_tk
}

...

user2_rqst = {
    'method': 'POST',
    'relative_url': 'method/fql.query?query=' + user2_qry,
    'body': 'access_token=' + user2_tk
}