I have run a test and change my code in order to return -1L in the getContentLength() method instead of file.lenth().... and it seems to work.
Is it the correct way to do this ? Regards. -----Message d'origine----- De : COURTAULT Francois [mailto:[EMAIL PROTECTED] Envoyé : mercredi 8 mars 2006 11:13 À : HttpClient Project Objet : RE: How to test chunked http request ? Hello, I have used the FileRequestEntity sample. So how to not specify a content length ? - Do I have to return -1L in the getContentLength() method instead of file.lenth() ? or - Do I have to remove the header using the removeRequestHeader("Content-Length") method ? Regards. -----Message d'origine----- De : Ortwin Glück [mailto:[EMAIL PROTECTED] Envoyé : mercredi 8 mars 2006 10:54 À : HttpClient Project Objet : Re: How to test chunked http request ? François, do not specifiy a content length and it resort to chunked encoding. Ortwin Glück COURTAULT Francois wrote: > Hello again, > > I have tried the sample you gave me with a big file (1,7 Mb). I have > activated the debug mode which gave me the following logging: > > DEBUG [httpclient.wire.header] >> "POST /DemoWar HTTP/1.1[\r][\n]" > ... > DEBUG [httpclient.wire.header] >> "User-Agent: Jakarta > Commons-HttpClient/3.0[\r][\n]" > ... > DEBUG [httpclient.wire.header] >> "Host: localhost:8080[\r][\n]" > ... > DEBUG [httpclient.wire.header] >> "Content-Length: 1771556[\r][\n]" > ... > DEBUG [httpclient.wire.header] >> "Content-Type: text/plain; > charset=UTF-8[\r][\n]" > ... > DEBUG [httpclient.wire.header] >> "[\r][\n]" > ... > DEBUG [httpclient.wire.content] >> "PRIVATE ENTERPRISE NUMBERS[\r][\n]" > ... > > I don't see any Content-Encoding: chunked or Transfer-Encoding: chunked in > the header !!! > > Any idea ? > > Regards. > > -----Message d'origine----- > De : Roland Weber [mailto:[EMAIL PROTECTED] Envoyé : mardi 7 > mars 2006 20:02 À : HttpClient Project Objet : Re: How to test chunked > http request ? > > Hello Francois, > > "don't be hasty" is the motto of the Ents :-) > http://en.wikipedia.org/wiki/Ent > >> I want to test http chunked request against Tomcat 5.x. > > HttpClient will use chunked encoding by default for HTTP/1.1 requests. Just > stream some data to the server. > > http://jakarta.apache.org/commons/httpclient/performance.html#Request/ > Response%20entity%20streaming > > cheers, > Roland > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > -- [web] http://www.odi.ch/ [blog] http://www.odi.ch/weblog/ [pgp] key 0x81CF3416 finger print F2B1 B21F F056 D53E 5D79 A5AF 02BE 70F5 81CF 3416 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
