0

I'm performing login on server using HttpPost method.

CommonsConnection.initHttpConnection();
HttpResponse response;
String contentOfMyInputStream;

HttpGet initPostMethod = new HttpGet("https://stat.volia.com:8443/ktvinet/index.jsp");
response = CommonsConnection.hc.execute(initPostMethod);

HttpPost Statistics = new HttpPost("https://stat.volia.com:8443/ktvinet/j_security_check");
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(3);

nameValuePairs.add(new BasicNameValuePair("j_username", "username"));
nameValuePairs.add(new BasicNameValuePair("j_password", "password"));
nameValuePairs.add(new BasicNameValuePair("submit", "%C2%EE%E9%F2%E8"));

Statistics.setEntity(new UrlEncodedFormEntity(nameValuePairs));
response = CommonsConnection.hc.execute(Statistics);

HttpGet mainPage = new HttpGet("https://stat.volia.com:8443/ktvinet/main.do");
response = CommonsConnection.hc.execute(mainPage);

contentOfMyInputStream = EntityUtils.toString(response.getEntity());

The response I get - body of webpage - is like 1/5 part of webpage, which ends with "...". Am I missing some parameter for httpclient ?

2 Answers 2

0

How are you examining the response? if you're looking int he debugger or something similar, it may well truncate long strings, try dumping it in a file.

1
  • That really was only problem of debugger, that can't show full response. Thanks!
    – saikek
    May 23, 2011 at 6:15
0

Logcat displays only part of long string response.

1
  • Thanks, i didn't realized it!
    – saikek
    May 23, 2011 at 6:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.