hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Khosro Asgharifard <khosro_quest...@yahoo.com>
Subject GetMethod returns differents stream length on the same URL in different request
Date Fri, 03 Sep 2010 19:50:25 GMT
I use HttpClient 3.1.
I use the following code :
    GetMethod httpGet;
    protected HttpClient client;
    client = new HttpClient(new MultiThreadedHttpConnectionManager());
    httpGet = new GetMethod(url);        
   int statusCode = client.executeMethod(httpGet);
            if (statusCode == HttpStatus.SC_OK) {
                       InputStream is = httpGet.getResponseBodyAsStream();
                       net.htmlparser.jericho.Source source = new 
                        numOfElemets = source.getAllElements().size();
                          System.out.println("numOfElemets " + numOfElemets);

When i out the above code in for loop ,it prints different number of elements in 
each loop(sometimes the same not always).
It seems the stream that retrieve by GetMethod is different in each request for 
the same URL.
It is a big problem for me.Do you know why this happens?
Best Regards.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message