I tryed to write an app that posts a form to a website and then gets the result which will later be used in Jsoup, but everytime the app is run I get the same website back as a result. The website:Link
I used this for an example:Link
I saw somewhere on this site that you have to put an action with the url but this doesn't work either.
Part of my app:
protected String doInBackground(String... params) {
String url = "http://www.ap-ljubljana.si/vozni_red2/VR1.php";
HttpPost post = new HttpPost(url);
List<NameValuePair> parameters = new ArrayList<NameValuePair>();
parameters.add(new BasicNameValuePair("VSTOP_IME", vhod));
parameters.add(new BasicNameValuePair("IZSTOP_IME", izhod));
try {
UrlEncodedFormEntity entity = new UrlEncodedFormEntity(parameters);
HttpClient client = new DefaultHttpClient();
post.setEntity(entity);
HttpResponse response = client.execute(post);
html_response = EntityUtils.toString(response.getEntity());
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
} catch (ClientProtocolException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
}