0

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;

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


The server committed a protocol violation. Section=ResponseStatusLine


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

jsp
  • 2,546
  • 5
  • 36
  • 63
  • Possible duplicates: http://stackoverflow.com/questions/11674938/the-server-committed-a-protocol-violation-section-responsestatusline-when-using http://stackoverflow.com/questions/2482715/the-server-committed-a-protocol-violation-section-responsestatusline-error – sergserg Oct 09 '12 at 13:54

1 Answers1

0

Check this link:

The server committed a protocol violation. Section=ResponseStatusLine

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.)

Attention to all web developers who are using Skype! Make sure to uncheck the option for using port 80 and 443 from Tools\Options\Connection dialog.

enter image description here

Kapil Khandelwal
  • 15,958
  • 2
  • 45
  • 52