Hi,
I am trying to post from android to GAE, I am getting unknown host exception. Here is my code,
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("http://silver-kites.appspot.com");
try {
// Add your data
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2);
nameValuePairs.add(new BasicNameValuePair("abc", "123"));
nameValuePairs.add(new BasicNameValuePair("xyz", "456"));
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
// Execute HTTP Post Request
HttpResponse response = httpclient.execute(httppost);
HttpEntity entity = response.getEntity();
if(entity != null){
InputStream inputStream = entity.getContent();
ResponseText.setText(convertStreamToString(inputStream));
}
} catch (ClientProtocolException e) {
ResponseText.setText(e.getMessage());
} catch (IOException e) {
ResponseText.setText(e.getMessage());
}
When I am trying to connect to localhost:8888 am getting connection refused. I donno how to go pass thru this. Help me.