在使用HttpWebrequest抓取信息的时候,遇到了一个错误!
The server committed a protocol violation. Section=ResponseStatusLine
解决办法:在Web.config中加入
<system.net>
<settings>
<httpWebRequest useUnsafeHeaderParsing="true" />
</settings>
</system.net>
<settings>
<httpWebRequest useUnsafeHeaderParsing="true" />
</settings>
</system.net>
再分享一下我老师大神的人工智能教程吧。零基础!通俗易懂!风趣幽默!还带黄段子!希望你也加入到我们人工智能的队伍中来!https://blog.youkuaiyun.com/jiangjunshow
本文详细介绍了在使用HTTPWebRequest抓取网页信息时遇到的“Theservercommittedaprotocolviolation”错误及其解决方案。通过在Web.config文件中添加特定配置,可以解决因服务器响应状态行引发的问题。
492

被折叠的 条评论
为什么被折叠?



