0
ログインする必要があるサイトでhtml(コードワイズ)を利用するためにApacheのhttpcomponentsを使用してログインしたセッションを使って、どうすればいいですか?httpcomponentsからセッションでHTMLを読む
これは、私がhttpcomponentsを使用したときのようになります。
HttpPost httpost = new HttpPost("http://whatever.com/login.php");
List<NameValuePair> nvps = new ArrayList<NameValuePair>();
nvps.add(new BasicNameValuePair("email", "whatever")); //set your own username
nvps.add(new BasicNameValuePair("password", "whatever")); //set your own password
httpost.setEntity(new UrlEncodedFormEntity(nvps, HTTP.UTF_8));
HttpResponse response = httpclient.execute(httpost);
HttpEntity entity = response.getEntity();
は、私は私の問題に対する答えがHttpEntityクラスでどこかにあることを前提としていますが、私は立ち往生午前ような気がします。..
明確にするには:上記のようにログインした後、上のセッションでログインする必要があるページにアクセスする必要があります(たとえばmembersonly.phpなど)。次にコンテンツを読み込んで使用する必要がありますJavaのこのページから。
私は自分自身を十分に明確にしました:)どんな答えを楽しみにしています。
マイクが