🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.pl.comp.lang.csharp
Article #9721

Re: HttpWebRequest a Chunked;

#9721
From: Rafal M
Date: Mon, 31 Oct 2005 09:29
29 lines
1812 bytes
adasiek wrote:
> Witam!
> 
> otoz mam stronke WWW, ktora chce pobrac za pomoca klas:
> HttpWebRequest, HttpWebResponse:
> 
> HttpWebRequest zapytanie =
>     new (HttpWebRequest)WebRequest.Create("host/sciezka/");
> HttpWebResponse odpowiedz = (HttpWebResponse)zapytanie.GetResponse();
> Stream strumien = odpowiedz.GetResponseStream();
> strumien.ReadToEnd() // error !!!
> 
> problem pojawia sie, jezeli serwer WWW odpowiada mi naglowkiem
> Transfer-encoding: chunked; niestety serwer musi tak odpowiadac,
> bo moje zapytanie musi byc HTTP/1.1 (ze wzgledu na vhosty); 
> StreamReader nie chce tego ruszyc; a klasa HttpWebResponse AFAIK
> nie ma zadnej innej metody, ktora zwracalaby tresc odpowiedzi :(
> 
> czy wiecie jak sie dobrac do takiej pofragmentowanej odpowiedzi??
> 
> pzdrv;
> adas;

A nie lepiej:

System.Net.WebClient w = new System.Net.WebClient();
w.DownloadFile(@"http://www.wp.pl", "strona.html");

?
Technical Details
Message-ID: <dk4o6p$q8$1@inews.gazeta.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!not-for-mail
References: <Xns96FDE3EBC47A9adasiek.podolany.net@127.0.0.1>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!not-for-mail
From: Rafal M <rafalm1980@gazeta.pl>
Newsgroups: alt.pl.comp.lang.csharp
Subject: Re: HttpWebRequest a Chunked;
Date: Mon, 31 Oct 2005 10:29:57 +0100
Organization: "Portal Gazeta.pl -> http://www.gazeta.pl"
Lines: 29
Message-ID: <dk4o6p$q8$1@inews.gazeta.pl>
References: <Xns96FDE3EBC47A9adasiek.podolany.net@127.0.0.1>
NNTP-Posting-Host: user0.167.udn.pl
Mime-Version: 1.0
X-Trace: inews.gazeta.pl 1130751001 840 82.139.0.167 (31 Oct 2005 09:30:01 GMT)
X-Complaints-To: usenet@agora.pl
NNTP-Posting-Date: Mon, 31 Oct 2005 09:30:01 +0000 (UTC)
In-Reply-To: <Xns96FDE3EBC47A9adasiek.podolany.net@127.0.0.1>
X-Accept-Language: en-us, en
X-User: rafalm1980
User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit