gpt4 book ai didi

c# - Fql 多查询在 graph explorer 中执行但不在 c# .net 中执行

转载 作者:太空宇宙 更新时间:2023-11-03 11:25:26 25 4
gpt4 key购买 nike

我有以下 Fql 查询:

https://graph.facebook.com/fql?q={"query1":"SELECT  uid2  FROM  friend  WHERE  uid1=me()","query2":"SELECT uid ,  name ,  pic_square , affiliations , birthday_date , sex , relationship_status , hometown_location , current_location , education_history , work_history , contact_email  FROM  user  WHERE (sex='male') AND uid  IN  (SELECT  uid2  FROM #query1)"}

这在 graph explorer 中工作正常,但在 c# 中不起作用;我收到一个 Http Badrequest 错误

我的查询如下:

"fql?q={'query1':'SELECT+uid2+FROM+friend+WHERE+uid1=me()','query2':'SELECT+uid,name,pic_square,affiliations,birthday_date,sex,relationship_status,hometown_location,current_location,education_history,work_history,contact_email+FROM+user+WHERE+(sex='male')+AND+uid+IN+(SELECT+uid2+FROM+#query1)'}";

请帮忙。

最佳答案

var fb = new Facebook.FacebookClient(token);
dynamic result = fb.Query(
"SELECT uid2 FROM friend WHERE uid1=me()",
"SELECT uid, name, pic_square, affiliations, birthday_date, sex, relationship_status, hometown_location, current_location, education_history, work_history, contact_email" +
" FROM user WHERE (sex='male') AND uid IN (SELECT uid2 FROM #query0)"
);

命名约定以索引 0 开头,而不是其他语言中的索引 1。上面的代码有效,我在 C# 中运行它并且结果很好。

关于c# - Fql 多查询在 graph explorer 中执行但不在 c# .net 中执行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9530195/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com