zoukankan      html  css  js  c++  java
  • 关于“服务器提交了协议冲突. Section=ResponseStatusLine"问题

    你的问题的原因是这样的,ASP.Net 2.0 增强了安全性,对一些有危害的http 头进行了判断,比如url中有空格的情况,以帮助网站提高网络攻击的防御能力。如果你的http头中有一些ASP.NET 认为是有危害的信息,则会返回这个错误。你访问百度没有问题,是因为百度根本就不是asp.net 做的。

    这个问题的解决办法是在你的 web.config 中添加如下配置:

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

    Service xx = new Service();

    XX.UserAgent=@" Mozilla/5.0 (Windows NT 6.1; WOW64; rv:30.0) Gecko/20100101 Firefox/30.0";

    详细解答请参见 微软在线技术支持的如下回答:

    http://www.velocityreviews.com/forums/t302174-why-do-i-get-quotthe-server-committed-a-protocol-violationquot.html

    原文:http://www.cnblogs.com/pcajax/archive/2011/03/10/1979954.html

  • 相关阅读:
    Android_Studio常用插件
    Android_Studio 及SDK下载
    Ubuntu 16.04 LTS 正式发布:系统将持续更新5年
    Windows通用应用平台
    Jquery局部打印插件
    WEB打印插件Lodop
    WEB打印插件jatoolsPrinter
    hdu1863
    PromiseKit入门
    高速排序
  • 原文地址:https://www.cnblogs.com/xcsn/p/4559947.html
Copyright © 2011-2022 走看看