I have created a program, tried to post a string on a site and I get this error:
"The server committed a protocol violation. Section=ResponseStatusLine"
after this line of code:
gResponse = (HttpWebResponse)gRequest.GetResponse();
How can I fix this exception?
Try putting this in your app/web.config:
<system.net>
<settings>
<httpWebRequest useUnsafeHeaderParsing="true" />
</settings>
</system.net>
If this doesn't work you may also try setting the KeepAlive
property to false.