Section=ResponseHeader Detail=标头名称无效
转自:http://www.sufeinet.com/thread-3831-1-1.html
问题:HttpHelper] 服务器提交了协议冲突. Section=ResponseHeader Detail=标头名称无效
解决方案:
winform的App.config或web的web.config中:
原文------------------------------------------------------------------
小小程序员() 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配置
[/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文件里加入
允许系统容忍(tolerant)只以CR或LF结尾的hearder信息 [/code]
本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!
