I debug it and found the headers are all correct. however, the last statement readData() just never returnes ... I tried many URLs using the same code, all works but this one on IIS :(
please help ...
---------------------------------------- HttpMethod method = null; method = new GetMethod(myURI);
method.setFollowRedirects(false);
method.setRequestHeader("Range", "bytes=" + start + "-" + (start + length -1));
method.setRequestHeader("Pragma", "no-cache");
method.setRequestHeader("Cache-Control", "no-cache");
method.setRequestHeader("Connection", "close");
method.setRequestHeader("Referer", u.getRefUrl());
method.setRequestHeader("Accept", "*/*");
int statusCode = -1;
statusCode = client.executeMethod(method);
InputStream in = method.getResponseBodyAsStream(); size = readData(in, length);
From: Michael Becke <[EMAIL PROTECTED]><[EMAIL PROTECTED]>
Reply-To: "Commons HttpClient Project"
To: "Commons HttpClient Project"<[EMAIL PROTECTED]>
Subject: Re: problem in working with IIS Date: Mon, 16 Feb 2004 23:11:16 -0500
It seems to be working just fine for me. Granted the server is a little slow, but it is working. What exactly are you trying, and what is the error you are seeing?
Mike
On Feb 16, 2004, at 10:31 PM, Cheng Hao wrote:
hi, I've used apache http client for a while, everything looks cool. until recently, I found a problem in working with IIS 5.0.
I'm trying to get part of a file who is located in a IIS server. i can correctly get its header, but when I try to retrieve the content, the connection never returns ...
following is the header I got, which seems all right ... could someone give it a shot or throw me some light? the URL is http://ehomenet.onlinedown.net/down/webcatcher_en.exe.
Thanks so much !!
------------------- Header --------------- Server:Microsoft-IIS/5.0 Connection:close Date:Tue, 17 Feb 2004 11:27:47 GMT Content-Type:application/octet-stream Last-Modified:Tue, 28 Oct 2003 13:26:12 GMT ETag:"549c38e579dc31:936" Content-Length:262144 Content-Range:bytes 0-262143/4439461
_________________________________________________________________
涓???虹????杩??浜ゆ?锛??浣跨? MSN Messenger: http://messenger.msn.com/cn
---------------------------------------------------------------------
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]
_________________________________________________________________
与联机的朋友进行交流,请使用 MSN Messenger: http://messenger.msn.com/cn
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]