Sunday, June 05, 2011

Full solution to: The server committed a protocol violation. Section=ResponseStatusLine

In most answers to this error you will get same answer:
<system.net>
    <settings>      
      <httpWebRequest useUnsafeHeaderParsing="true" />
    </settings>
</system.net>

But not always a problem will be resolved. A full solutions to error present here. Just add next row to request variable:

   request.KeepAlive = false;

OR

   ((HttpWebRequest)request).KeepAlive = false; (Where request type is WebRequest)

No comments: