Re: Disabling chunking in HTTP 1.1
- From: Joerg Jooss <news-reply@xxxxxxxxxxxxx>
- Date: Wed, 14 Feb 2007 19:05:51 +0000 (UTC)
Thus wrote joseph_gallagher@xxxxxxxxxxx,
Hi,
I'm not sure if this is the right place to post this but when
searching for the exception I got this group came up the most.
It's the right place :-)
I'm making a HttpWebRequest to get data from a web page but am getting
the following error
System.Net.WebException: The server committed a protocol violation.
Section=ResponseBody Detail=Response chunk format is invalid
at System.Net.HttpWebRequest.GetResponse()
I've looked in the groups and the recomended fix for this error is to
set
<system.net>
<settings>
<httpWebRequest useUnsafeHeaderParsing="true" />
</settings>
</system.net>
in the App.config but this isnt working for me, playing around I find
that if I set the version in the HttpWebRequest to 1.0 like so
That would be a severe bug on the server-side. Is this a public site? Or is there a web proxy in between?
HttpWebRequest hwr = (HttpWebRequest)
HttpWebRequest.Create(url.Text);
hwr.ProtocolVersion = new System.Version(1,0);
then everything runs fine, running a packet sniffer I see this is
becuase I'm not recieving the data chunked, is there a header I can
set so I can carry on using 1.1 but not get chunked data as this is
obviously whats causing the problem and I dont really want to use http
1.0.
Understandable. But it's the server's decision whether to use chunking or not. A HTTP 1.1 client must support chunking, so there's no way to avoid chunking without reverting to HTTP 1.0.
Failing that does anyone know what is causing this problem?
Not without having a look at the actual traffic.
Cheers,
--
Joerg Jooss
news-reply@xxxxxxxxxxxxx
.
- Follow-Ups:
- Re: Disabling chunking in HTTP 1.1
- From: joseph_gallagher
- Re: Disabling chunking in HTTP 1.1
- References:
- Disabling chunking in HTTP 1.1
- From: joseph_gallagher
- Disabling chunking in HTTP 1.1
- Prev by Date: Re: Enterprise Library Deployment
- Next by Date: XmlSerializer and Custom Attribute Inclusion?
- Previous by thread: Disabling chunking in HTTP 1.1
- Next by thread: Re: Disabling chunking in HTTP 1.1
- Index(es):
Relevant Pages
|