错误时,解析RSS [英] Error when Parsing RSS

查看:180
本文介绍了错误时,解析RSS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图解析RSS提要,然后在我的网站上显示。我的code似乎TechCrunch的分析与放大器时,正常工作; arstechnica RSS。但是,当我尝试分析HackerNews RSS 我得到了一个错误。

I 'm trying to parse RSS feeds and then display them on my website. My code seems to work correctly when parsing techcrunch & arstechnica RSS. But when I try to parse HackerNews RSS I get the an error.

    XmlReader readXML;
    readXML = XmlReader.Create(GetURL());
    SyndicationFeed News= SyndicationFeed.Load(readXML);
    readXML.Close();
    return News;

我得到的 ReadXML的= XmlReader.Create(的GetURL())以下的错误; 的getURL是URL的RSS。

I get the following error on readXML = XmlReader.Create(GetURL()); geturl is the url for rss.

服务器犯了违反协议。第= ResponseStatusLine

The server committed a protocol violation. Section=ResponseStatusLine

为什么我越来越上述错误的任何建议。 谢谢


Any suggestions why I 'm getting the above error. Thanks

推荐答案

检查此链接:

服务器犯了违反协议。第= ResponseStatusLine

1)您可以添加以下< HttpWebRequest的useUnsafeHeaderParsing =真/> 在Web配置文件来解决服务器提交了协议冲突

1.) You can add the following <httpWebRequest useUnsafeHeaderParsing="true" /> in the Web Config file to solve the server committed a protocol violation

<configuration>
<system.net>
<settings>
<httpWebRequest useUnsafeHeaderParsing="true" />
</settings>
</system.net>
</configuration> 

2。)

注意谁在使用Skype的所有Web开发人员!确保取消使用端口80和443,从工具\选项\连接对话框中的选项。

这篇关于错误时,解析RSS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆