服务器犯了违反协议。第= ResponseStatusLine ERROR [英] The server committed a protocol violation. Section=ResponseStatusLine ERROR

查看:731
本文介绍了服务器犯了违反协议。第= ResponseStatusLine ERROR的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了一个计划,试图张贴在网站上一个字符串,我得到这个错误:

I have created a program, tried to post a string on a site and I get this error:

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

"The server committed a protocol violation. Section=ResponseStatusLine"

这行code后:

gResponse = (HttpWebResponse)gRequest.GetResponse(); 

我怎样才能解决这个例外?

How can I fix this exception?

推荐答案

尝试把这个在您的应用程序/ web.config中:

Try putting this in your app/web.config:

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

如果这不工作,你也可以尝试设置<一个href=\"http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.keepalive.aspx\"><$c$c>KeepAlive属性设置为false。

If this doesn't work you may also try setting the KeepAlive property to false.

这篇关于服务器犯了违反协议。第= ResponseStatusLine ERROR的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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