Section=ResponseHeader Detail=标头名称无效
来源:互联网 发布:怎么用java写服务器 编辑:程序博客网 时间:2024/05/29 11:13
转自:http://www.sufeinet.com/thread-3831-1-1.html
问题:HttpHelper] 服务器提交了协议冲突. Section=ResponseHeader Detail=标头名称无效
解决方案:
winform的App.config或web的web.config中:
<?xml version="1.0"?><configuration> <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/> </startup> <system.net> <settings> <httpWebRequest useUnsafeHeaderParsing="true" /> </settings> </system.net></configuration>
原文------------------------------------------------------------------
小小程序员() 11:06:51
我的代码:string url = "http://192.168.0.184/cgi-bin/wagent?webipcinfo+list";
HttpHelper httpHelper = new HttpHelper();
HttpItem item=new HttpItem ();
item.URL=url ;
item.ResultType = ResultType.String;
HttpResult r = httpHelper.GetHtml(item);
小小程序员() 11:07:20
它提示:服务器提交了协议冲突. Section=ResponseHeader Detail=标头名称无效
PerkySu() 11:08:13
ContentType = "text/html"这个参数没有设置
PerkySu() 11:09:05
要返回什么样的数据要写成什么样的头信息的。
PerkySu() 11:09:09
http://www.sufeinet.com/thread-1866-1-1.html
小小程序员() 11:10:13
设置了也不行
小小程序员() 11:10:57
还是提示:服务器提交了协议冲突. Section=ResponseHeader Detail=标头名称无效
PerkySu() 11:12:52
myRequest.ContentType = "application/x-www-form-urlencoded";
PerkySu() 11:13:04
item.ContentType = "application/x-www-form-urlencoded"
PerkySu() 11:13:45
[code=csharp]服务器提交了协议冲突.Section=ResponseHeader Detail=CR 后面必须是LF.
微软没有容忍不符合RFC 822中的httpHeader必须以CRLF结束的规定的服务器响应所导致.
解决方案分别是在web.config配置
<system.net>
<settings>
<httpWebRequest useUnsafeHeaderParsing=”true” />
</settings>
</system.net>
[/code]
PerkySu() 11:14:13
我建议你去看看Httphelper原理再写,要不然你的问题让我很头疼。
PerkySu() 11:14:20
问的很另类
小小程序员() 11:14:26
小小程序员() 11:17:44
在Config中配置下,可以了
小小程序员() 11:17:55
谢谢,老大
小小程序员() 11:18:24
苏飞你真是程序员的福音啊
----------------------------------
[code=csharp]服务器提交了协议冲突. Section=ResponseHeader Detail=CR 后面必须是 LF
The server committed a protocol violation. Section=ResponseHeader Detail=CR must be followed by LF
主体意思是微软没有容忍不符合RFC 822中的httpHeader必须以CRLF结束的规定的服务器响应。
解决方案是在app.config或web.config文件里加入
<configuration>
<system.net>
<settings>
<httpWebRequest useUnsafeHeaderParsing="true" />
</settings>
</system.net>
</configuration><?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.net>
<settings>
<httpWebRequest useUnsafeHeaderParsing="true" />
</settings>
</system.net>
</configuration>
允许系统容忍(tolerant)只以CR或LF结尾的hearder信息 [/code]
- Section=ResponseHeader Detail=标头名称无效
- 服务器提交了协议冲突.Section=ResponseHeader Detail=CR 后面必须是LF
- 服务器提交了协议冲突.Section=ResponseHeader Detail=CR后面必须是LF
- 服务器提交了协议冲突.Section=ResponseHeader Detail=CR 后面必须是LF .
- C# 服务器提交了协议冲突Section=ResponseHeader Detail=CR 后面必须 LF
- The server committed a protocol violation. Section=ResponseHeader Detail=CR must be followed by LF
- ASP.NET 中抓取网页内容 并出现服务器提交了协议冲突. Section=ResponseHeader 解决方案
- dev gridcontrol 取某一列的列头名称
- detail
- http://www.wlerp.com/News/detail.asp?id=22
- http://e.163.com/?docid=BD2MPSC000964LD0#detail/23/BD2MPSC000964LD0
- Postgresql数据库DETAIL: Key (irecordid)=(25) already exists.
- Section=ResponseStatusLine的解决
- Servlet(二)--ResponseHeader
- ValidateRequest="false" 无效
- http://student.csdn.net/space.php?do=course&cid=456&ac=detail
- <c:foreach var="detail" items="${mailManager.detailList}" varStatus="status"
- http://geek.csdn.net/news/detail/108595?locationNum=1&fps=1
- linux通过grep kill掉tomcat进程脚本,百分百kill掉
- ie9的placeholder不显示的解决办法(包含多个密码框)
- Another unnamed CacheManager already exists in the same VM.解决方法
- 学习网站/博客论坛推荐(二)
- JAVA常用方法
- Section=ResponseHeader Detail=标头名称无效
- 改变Dialog的样式
- POJ 3253 Fence Repair(贪心—霍夫曼树or优先队列)
- oracle创建表空间和用户
- 灵活运用 SQL SERVER FOR XML PATH
- MVC4 无刷新分页!
- HTML点击事件重叠的处理
- EI 和 SCI 检索号查询
- jquery实现弹窗效果实例