Apache HTTPClient returns an empty page
- by mariosangiorgio
Hi,
I am using the Apache HTTPClient for Java and I'm facing a really strange issue. Sometimes when I try to get a dynamically generated page it returns its actual content, but other times (with another parameter) all I get is a short sequence of \t,\r and \n.
How could I track what's going on on the different cases in order to find where is the bug?
My usage of the library is pretty straightforward, all I do is this few calls on an initialized HTTPClient object:
String content = "/pageIwant.jsp?parameter=10101010";
HttpGet request = new HttpGet(content);
HttpResponse response = client.execute(targetHost, request);
HttpEntity entity = response.getEntity();
String page = EntityUtils.toString(entity);