0

HttpPostメソッドを使用してサーバーにログインしています。

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());

私が得た応答(ウェブページの本文)は、ウェブページの1/5の部分のようで、「...」で終わります。httpclientのパラメータが不足していますか?

4

2 に答える 2

0

応答をどのように調べていますか?デバッガーなどを探している場合は、長い文字列を切り捨てる可能性があります。ファイルにダンプしてみてください。

于 2011-05-23T05:38:06.187 に答える
0

Logcatは、長い文字列応答の一部のみを表示します。

于 2011-05-23T05:50:51.370 に答える