软件编程
位置:首页>> 软件编程>> C#编程>> HttpWebRequest出错.Section=ResponseHeader Detail=CR

HttpWebRequest出错.Section=ResponseHeader Detail=CR

  发布时间:2022-07-11 22:10:10 

标签:HttpWebRequest出错.Section=ResponseHeader,Detail=CR

服务器提交了协议冲突. Section=ResponseHeader Detail=CR 后面必须是 LF 

The server committed a protocol violation. Section=ResponseHeader Detail=CR must be followed by LF

主体意思是微软没有容忍不符合RFC 822中的httpHeader必须以CRLF结束的规定的服务器响应。

一个解决方案是在application.config或web.config文件里加入

  <system.net>

    <settings>

      <httpWebRequest useUnsafeHeaderParsing="true" />

    </settings>

  </system.net>

允许系统容忍(tolerant)只以CR或LF结尾的hearder信息

0
投稿

猜你喜欢

手机版 软件编程 asp之家 www.aspxhome.com