【发布时间】:2010-02-26 22:37:46
【问题描述】:
我正在尝试使用 REST API 从 fb 获取好友列表。
ArrayObject 填充:
- 密钥
- API_KEY 方法 = "facebook.friends.get"
- call_id uid
- v = 1.0
- sig = md5 代码
我正在尝试拨打电话:
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();
}
但我在这里遇到了一个例外:
theResponse = (HttpWebResponse) theRequest.GetResponse();
带有以下信息:
远程服务器返回错误: (500) 内部服务器错误。
【问题讨论】: