Re: Disabling chunking in HTTP 1.1



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


.



Relevant Pages

  • Re: Borland Socket Service
    ... Here's the code sample with THTTPSend. ... HTTP: THTTPSend; ... but the exception still exists and will rear it's ugly head ... I don't know how Indy works, but this is not simple enough for me and I don't know how comes it's so complex to accomplish some easy tasks. ...
    (borland.public.delphi.non-technical)
  • Re: WebException mit Code 513
    ... > würde in der Exception wohl auch ein Timeout erwähnt werden). ... "513" ist aber offenbar kein HTTP Statuscode. ... Prev by Date: ... Next by Date: ...
    (microsoft.public.de.german.entwickler.dotnet.framework)
  • This collection already contains an address with scheme http
    ... I get this error when I navigate to a web page hosting a WCF service: ... '/services/myservice.svc' cannot be activated due to an exception during ... address with scheme http. ...
    (microsoft.public.dotnet.framework.webservices)
  • Index.dat For IE History
    ... I would like to read this file to get http address, ... In searching the Web I found the following references. ... Prev by Date: ...
    (microsoft.public.dotnet.languages.vb)
  • Re: win98 outgoing connections
    ... Have you tried searching your registry for those URLs. ... > 192.168.1.100 speed.conveysystems.com HTTP ... > These connections come very frequently - only seconds apart as long as ... I can't find any spyware running. ...
    (comp.security.misc)