如何通过 Digg API 提取 Digg 数据
我正在尝试使用以下 URL 为用户提取 Digg 数据:
“http://services.digg.com/user/vamsivanka/diggs?count=25&appkey=34asd56asdf789as87df65s4fas6”,
并且 Web 响应抛出错误“远程服务器返回错误:(403) 禁止。 ”
请告诉我。
public static XmlTextReader CreateWebRequest(string url)
{
HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(url);
webRequest.UserAgent = ".NET Framework digg Test Client";
webRequest.Credentials = System.Net.CredentialCache.DefaultCredentials;
webRequest.Accept = "text/xml";
HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse();
System.IO.Stream responseStream = webResponse.GetResponseStream();
XmlTextReader reader = new XmlTextReader(responseStream);
return reader;
}
I am trying to extract Digg data for a user using this URL:
"http://services.digg.com/user/vamsivanka/diggs?count=25&appkey=34asd56asdf789as87df65s4fas6"
and the web response is throwing an error "The remote server returned an error: (403) Forbidden."
Please let me know.
public static XmlTextReader CreateWebRequest(string url)
{
HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(url);
webRequest.UserAgent = ".NET Framework digg Test Client";
webRequest.Credentials = System.Net.CredentialCache.DefaultCredentials;
webRequest.Accept = "text/xml";
HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse();
System.IO.Stream responseStream = webResponse.GetResponseStream();
XmlTextReader reader = new XmlTextReader(responseStream);
return reader;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论