I am trying to use REST API to get friends lists from fb.
ArrayObject is filled with:
- SecretKey
- API_KEY Method = "facebook.friends.get"
- call_id uid
- v = 1.0
- sig = md5 code
And I'm trying to make the call with:
public string GetResponse(ArrayObject Parameters)
{
// Set the encoding type
theRequest.ContentType = "application/x-www-form-urlencoded";
theRequest.ContentLength = Parameters.getData().Length;
// We write the parameters into the request
StreamWriter sw = new StreamWriter(theRequest.GetRequestStream());
sw.Write(Parameters.getData());
sw.Flush();
sw.Close();
// Execute the query
theResponse = (HttpWebResponse)theRequest.GetResponse();
StreamReader sr = new StreamReader(theResponse.GetResponseStream());
return sr.ReadToEnd();
}
But I get an exception here:
theResponse = (HttpWebResponse) theRequest.GetResponse();
with a Message of:
The remote server returned an error: (500) Internal Server Error.