title: Login on website with java
body: <p>I would like to login to a website with java. I use the org.apache.http and I already written</p>
  
  <pre><code>HttpClient client = new DefaultHttpClient();
  HttpPost post = new HttpPost("https://accounts.google.com/ServiceLogin?      service=mail&amp;passive=true&amp;rm=false&amp;continue=https%3A%2F%2Fmail.google.com%2Fmail%2F%3Fhl%3Dsl%26tab%3Dwm%26ui%3Dhtml%26zy%3Dl&amp;bsv=llya694le36z&amp;scc=1&amp;ltmpl=default&amp;");
  try {
  List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;(1);
  nameValuePairs.add(new BasicNameValuePair("vb_login_username",
                      "XXX"));
  nameValuePairs.add(new BasicNameValuePair("vb_login_password",
                      "XXX"));
  post.setEntity(new UrlEncodedFormEntity(nameValuePairs));
  HttpResponse response = client.execute(post);
  BufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
  String line = "";
  while ((line = rd.readLine()) != null) {
  System.out.println(line);
              }
  } catch (IOException e) {
  e.printStackTrace();
          }
  </code></pre>
  
  <p>It sends the post form correctly i have tested, though i still cant login. The website I want to login is <a href="http://www.xtratime.org/forum/" rel="noreferrer">http://www.xtratime.org/forum/</a>  Any ideas for this or is there a different way?</p>