ログインが必要なサイトで html を (コード単位で) 利用するために Apache の httpcomponents を使用して達成したログイン セッションを使用するにはどうすればよいでしょうか?
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のこのページから。
私が自分自身を十分に明確にしたことを願っています:)どんな答えも楽しみにしています。
マイク