• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

org.apache.commons.httpclient response not getting

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi
i am using org.apache.commons.httpclient with GetMethod

when i am giving same url in for loop
after some iterations the system is hanging at
method.getResponseBodyAsSting() or at method.getResponseBodyAsString();
the code is like this
for(int i=0; i<200 ; i++) {
HttpClient client = new HttpClient();
GetMethod method = new GetMethod(someurl);
int statuscode = client.executeMethod(method);
String str = method.getResponseBodyAsString(); // the system is
// hanging here
System.out.println(statuscode);
System.out.println(str);
method.releaseConnection();

}

can any body please give the reason
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving to Other Open Source Projects...
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please do not post the same question to multiple forums especially after a moderator instructs you not to .
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic