如何订阅facebook实时更新?

时间:2014-02-05 07:51:03

标签: c#

这是我正在使用的代码。在HttpResponse,它每次都说“糟糕的请求”。

string verify = "testing";
string ul = "access_token=app_accesstoken&object=page&callback_url=my url&fields=feed&verify_token=" + verify;
HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create("https://graph.facebook.com/app_id/subscriptions");

webRequest.Method = "POST";
byte[] postBytes = Encoding.ASCII.GetBytes(ul);
webRequest.ContentType = "application/x-www-form-urlencoded";
webRequest.ContentLength = postBytes.Length;
System.IO.Stream requestStream = webRequest.GetRequestStream();
//Write
requestStream.Write(postBytes, 0, postBytes.Length);
requestStream.Close();

HttpWebResponse Response1 = (HttpWebResponse)webRequest.GetResponse();
StreamReader sr1 = new StreamReader(Response1.GetResponseStream());
String strMainPage1 = sr1.ReadToEnd();

0 个答案:

没有答案