var webRequest = (HttpWebRequest)HttpWebRequest.Create("https://graph.facebook.com/");
webRequest.Method = "POST";
webRequest.ContentType = "application/x-www-form-urlencoded";
var requestString = "fql?q=SELECT status_id, message FROM status
WHERE uid=me()";
byte[] bytedata = Encoding.UTF8.GetBytes(requestString);
webRequest.ContentLength = bytedata.Length;
var requestStream = webRequest.GetRequestStream();
requestStream.Write(bytedata, 0, bytedata.Length);
requestStream.Close();
var response = webRequest.GetResponse();
var responseStream = new StreamReader(response.GetResponseStream());
var responseString = responseStream.ReadToEnd();
我正在尝试获取我的 fb 帐户的状态消息,上面的代码抛出了错误的请求,而这个使用 facebook api 获取请求的消息说参数无效
string accessToken = ViewState["accessToken"].ToString();
Facebook.FacebookClient fb = new FacebookClient(accessToken);
dynamic me = fb.Get("/me");
var id = me.id;
string query = "SELECT status_id, message FROM status WHERE uid=me()";
var posts = fb.Get("/fql?q=SELECT status_id, message FROM status WHERE uid=me()");
任何帮助将不胜感激.. facebook 给了我 headbangings.. :\ 最后一件事是上面的查询在 fql graph api 模拟器中完美运行
https://developers.facebook.com/tools/explorer?method=GET&path=uridfields%3Did%2Cname