虚位以待(AD)
虚位以待(AD)
首页 > 软件编程 > C#编程 > HttpWebRequest出错.Section=ResponseHeader Detail=CR

HttpWebRequest出错.Section=ResponseHeader Detail=CR
类别:C#编程   作者:码皇   来源:互联网   点击:

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信息
相关热词搜索: HttpWebRequest出错 Section=ResponseHead