本文介绍了服务器犯了违反协议。第= ResponseStatusLine ERROR的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经创建了一个计划,试图张贴在网站上一个字符串,我得到这个错误:
I have created a program, tried to post a string on a site and I get this error:
服务器犯了违反协议。部分= 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>
如果这不工作,你也可以尝试设置<$c$c>KeepAlive属性设置为false。
If this doesn't work you may also try setting the KeepAlive
property to false.
这篇关于服务器犯了违反协议。第= ResponseStatusLine ERROR的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!