记录常见的HTTP请求错误

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

解决方案:winfrom 在app.config种添加 web 在 web.config种添加

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

  

基础连接已经关闭: 发送时发生错误。

https协议问题,增加

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

 http协议问题,增加

request.ProtocolVersion = HttpVersion.Version10;  

  

posted @ 2018-02-11 14:04  野生程序员  阅读(209)  评论(0编辑  收藏  举报