惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

GbyAI
GbyAI
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Security Archives - TechRepublic
Security Archives - TechRepublic
H
Heimdal Security Blog
T
Tenable Blog
Webroot Blog
Webroot Blog
Cisco Talos Blog
Cisco Talos Blog
NISL@THU
NISL@THU
Help Net Security
Help Net Security
W
WeLiveSecurity
量子位
Stack Overflow Blog
Stack Overflow Blog
Schneier on Security
Schneier on Security
Simon Willison's Weblog
Simon Willison's Weblog
Recorded Future
Recorded Future
Martin Fowler
Martin Fowler
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
L
Lohrmann on Cybersecurity
SecWiki News
SecWiki News
Blog — PlanetScale
Blog — PlanetScale
F
Full Disclosure
Recent Commits to openclaw:main
Recent Commits to openclaw:main
小众软件
小众软件
Cyberwarzone
Cyberwarzone
S
Security Affairs
L
LangChain Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
V
V2EX
WordPress大学
WordPress大学
爱范儿
爱范儿
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
L
LINUX DO - 热门话题
Forbes - Security
Forbes - Security
Engineering at Meta
Engineering at Meta
博客园 - 三生石上(FineUI控件)
Scott Helme
Scott Helme
H
Help Net Security
www.infosecurity-magazine.com
www.infosecurity-magazine.com
C
Cyber Attacks, Cyber Crime and Cyber Security
有赞技术团队
有赞技术团队
IT之家
IT之家
G
Google Developers Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
S
Schneier on Security
Google DeepMind News
Google DeepMind News
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
月光博客
月光博客
Hacker News: Ask HN
Hacker News: Ask HN
O
OpenAI News
宝玉的分享
宝玉的分享

博客园 - lui

阿里云SSL证书到期(续期)图文教程 IIS7配置HTTPS+默认访问https路径 SQL将多行数据合并成一行【转】 arcgis 服务网页打开需要输入用户名和密码问题解决 Arcgis for js加载百度地图 android-studio-ide 安装到运行第一个helloword,坑记录 Hyper-V虚拟机联网设置 arcgis--arcmap导出点的X,Y坐标 mysql查看锁表与解锁 arcgis10.2怎么把地理坐标系转化为投影坐标系(平面,米制坐标) arcmap 10.2 从 WGS_1984 转 Beijing_1954 mysql 转换13位数字毫秒时间 【win10系统问题】远程桌面登录一次后,第二次登录看不到用户名和密码输入框 如何更改Arcmap里经纬度小数点后面的位数? 腾讯视频qlv格式转换MP4普通视频方法 kettle_Spoon 修改共享DB连接带汉字引发的错误 AutoCAD2015激活码和密钥 SQL获取本周,上周,本月,上月第一天和最后一天[注:本周从周一到周天] SQL语句 不足位数补0 java.net.ProtocolException: Server redirected too many times
c# winform 服务器提交了协议冲突. Section=ResponseStatusLine
lui · 2018-01-28 · via 博客园 - lui

【转】

最近在用.net写一个网络蜘蛛,发现对有的网站用HttpWebrequest抓取网页的时候会报错,捕获异常提示:"服务器提交了协议冲突 Section=ResponseStatusLine ”,改用WebClient也是同样问题,后来知道,WebClient是对HttpWebrequest进一步进行了封装。
最后终于找到问题根源:The  server  committed  a  protocol  violation.  Section=ResponseHeader  Detail=CR  must  be  followed  by  LF 微软没有容忍不符合RFC  822中的httpHeader必须以CRLF结束的规定的服务器响应。
通过修改配置文件解决:在app.config或config.Config , 文件在项目的bin\Debug目录下;(WinForm)或web.config(Web)文件里修改。

WinForm下的app.config文件中添加:

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

完整 app.config文件
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.net> 
        <settings> 
               <httpWebRequest useUnsafeHeaderParsing="true" />
        </settings> 
    </system.net>
</configuration>


编译以后会在Debug下面自动创建一个 程序名.exe.config 的配置文件
希望大家能少走弯路,Good Luck~