hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cheng Hao" <haochen...@hotmail.com>
Subject Re: problem in working with IIS
Date Tue, 17 Feb 2004 05:33:27 GMT
thanks for your prompt response, following is my code --

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.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 <becke@u.washington.edu>
>Reply-To: "Commons HttpClient Project" 
>To: "Commons HttpClient Project" 
>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?
>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 
>>Thanks so much !!
>>------------------- Header ---------------
>>Date:Tue, 17 Feb 2004 11:27:47 GMT
>>Last-Modified:Tue, 28 Oct 2003 13:26:12 GMT
>>Content-Range:bytes 0-262143/4439461
>>与联机的朋友进行交流,请使用 MSN Messenger:  
>>To unsubscribe, e-mail: 
>>For additional commands, e-mail: 
>To unsubscribe, e-mail: 
>For additional commands, e-mail: 

ѽнʹ MSN Messenger:  http://messenger.msn.com/cn  

To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org

View raw message