I need to get multiple users off of facebook in one call, sending the ids of the desired users, i won’t know how many users i need to get each time, as it is dynamic.
Have searched multiple places, and managed to find a few solutions however none that seem quite viable or efficient.
One is a foreach, using the facebook c# sdk get method… really not efficient.
The closest i have managed to come is with the following, where s would be a string of comma delimited ids:
var requestString = string.Format("https://graph.facebook.com?ids={0}", s);
var request = (HttpWebRequest)WebRequest.Create(requestString);
request.ContentType = "GET";
try
{
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
if (response != null)
{
if (response.StatusCode == HttpStatusCode.OK)
{
Stream stream = response.GetResponseStream();
using (StreamReader reader = new StreamReader(stream))
{
var html = reader.ReadToEnd();
}
}
response.Close();
}
}
catch { }
This returns what i need in some horrible html format.
Is there a better way to do this, either using batch requests, or using a simple get?
Thank you
I would go with batch requests over the comma-delimited ids. At least then you are shown a pre-defined json structure that they will send you.