I am trying to get a facebook feed (public message) that does not require access to the token. here is the URL
https://www.facebook.com/feeds/page.php?format=json&id=1393547494231876
when I launch this in a browser, where id = any facebook page id. it returns the first 25 public messages in json format. but when I ran this in my code to get the json result facebook, return the page with the message "unsupported browser", this is my method. I pass him the facebook page id to receive the messages.
public static String GetPosts(string PageId)
{
string id = PageId;
string apilink = "https://www.facebook.com/feeds/page.php?format=json&id=";
HttpWebRequest request = WebRequest.Create(apilink + id) as HttpWebRequest;
request.Method = WebRequestMethods.Http.Get;
request.Accept = "application/json";
request.ContentType = "application/json; charset=utf-8";
using (HttpWebResponse response = request.GetResponse() as HttpWebResponse)
{
StreamReader reader = new StreamReader(response.GetResponseStream());
String result = reader.ReadToEnd();
return result;
}
}
Here is the result that I get in the return
line
.. .
- , ?
...
, Facebook , .
request.UserAgent = ".NET Framework";
.
.