1

我想做一个批处理请求并使用依赖项,但我需要增加我收到的 id。正如您在下面看到的,我尝试了一些不同的想法,但它们不起作用。任何人都得到这个工作?

var q = {batch:[{"name":"get-friends", "method":"GET","relative_url":"me/friends","omit_response_on_success": false},
                {"method":"GET","relative_url":"/?ids={result=get-friends:$.data[*].id}"},
                {"method":"GET","relative_url":"{result=get-friends:$.data[*].id}/mmxstaging:watch"},
                {"method":"GET","relative_url":"/mmxstaging:share?ids={result=get-friends:$.data[*].id}"}]};

FB.api('/', 'post', q, function(response) {
    console.log(response);
});
4

1 回答 1

1

你找到解决方案了吗?如果不是这里是我的解决方案:

var q = {batch:[{"name":"get-friends", "method":"GET","relative_url":"me/friends","omit_response_on_success": false},
            {"method":"GET","relative_url":"/?ids={result=get-friends:$.data.*.id}"},
            {"method":"GET","relative_url":"{result=get-friends:$.data.*.id}/mmxstaging:watch"},
            {"method":"GET","relative_url":"/mmxstaging:share?ids={result=get-friends:$.data.*.id}"}]};

FB.api('/', 'post', q, function(response) {
    console.log(response);
});

我已经用其他代码进行了测试,它可以工作,它会得到朋友,然后自动检查每个朋友的 id 并为我完成任务。

如果您需要任何其他帮助,请告诉我。

PS很抱歉碰到这个老问题。

于 2012-10-13T19:37:18.897 回答