当前位置: 移动技术网 > IT编程>开发语言>c# > HttpWebRequest出错.Section=ResponseHeader Detail=CR

HttpWebRequest出错.Section=ResponseHeader Detail=CR

2019年07月18日  | 移动技术网IT编程  | 我要评论
服务器提交了协议冲突. section=responseheader detail=cr 后面必须是 lf  the&nb
服务器提交了协议冲突. 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信息

如您对本文有疑问或者有任何想说的,请点击进行留言回复,万千网友为您解惑!

相关文章:

验证码:
移动技术网