Unfortunately. I'm sorry. It looks like you are trying to do POST through a browser.
Here is a snippet that I used to perform HTTP POST on Android without going through a web browser:
HttpClient httpClient = new DefaultHttpClient(); HttpConnectionParams.setConnectionTimeout(httpClient.getParams(), TIMEOUT_MS); HttpConnectionParams.setSoTimeout(httpClient.getParams(), TIMEOUT_MS); HttpPost httpPost = new HttpPost(url); List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(); nameValuePairs.add(new BasicNameValuePair("name1", "value1")); nameValuePairs.add(new BasicNameValuePair("name2", "value2")); nameValuePairs.add(new BasicNameValuePair("name3", "value3"));
I think this should work on what you are trying to do. I have TIMEOUT_MS set to 10000 (so, 10 seconds)
Then you can read the server response using something like this:
BufferedReader br = new BufferedReader(new InputStreamReader(response.getEntity().getContent()), 8096);
source share