0
 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

4

1 回答 1

0

我猜你正在寻找这个:Facebook Graph API - User
Under Connections 你会发现“状态”。

为了获得所有状态的数组,您必须致电/me/statuses?access_token=ACCESS_TOKEN 您必须获得read_stream许可。

希望我能帮上忙。

编辑:在 WinRT 的情况下:我会以另一种方式调用 Graph API(不知道它是否更好,但它也可以):

// Example Uri
Uri requestUri = new Uri("https://graph.facebook.com/me/statuses?access_token=ACCESS_TOKEN");    

HttpClient client = new HttpClient();
HttpResponseMessage response = await client.GetAsync(requestUri);

string content = await response.Content.ReadAsStringAsync();
return content;
于 2012-10-28T13:01:41.477 回答