json - Getting Facebook Page Feed ( using graph api ) in asp.net, receiving error "Unsupported Browser" -


I am trying to get a Facebook page feed (public post) for which no access token is required. Here's the URL when I run it in the browser where id = any Facebook Page ID returns it to the first 25 public posts in the JSON format but when I go into my code to get it JSON result then "unsupported browser" A page is returned by saying that this is my way to get the post. I pass it a Facebook Page ID.

  Public Stabilized String GetPosts (String PageID) {st Ring id = PageId; String uplink = "https://www.facebook.com/feeds/page.php?format=json&id="; HttpWebRequest request = WebRequest.Create (apilink + ID) as HttpWebRequest; request. Method = WebRest Methods. Hpp gate; request. Accept = "App / JS"; Request.ContentType = "Application / Jason; Charset = UTF-8"; // Receive feedback using HttpWebResponse response = request.GetResponse () as HttpWebResponse {// Receive feedback stream stream reader = new streamer (response. GETResponsestream ()); // Console Application Output String Results = Reader Readout (); Return result; }}  

The result is that I get in the return string

and returned to the rest of the page. Can someone help me how can this work?

Update found ... I have to set user agent to make users, I think I am a browser .. Request.UserAgent = ".NET Framework "; And I did all thanks to thank you.

get answer ... let me set user to make agent For Facebook, I think I am a browser. Then just request has been added. UserAgent = ".NET Framework"; And I did all thanks to thank you.


Comments