Connecting to a web server over HTTP, code snippet
- by Emanuil
I'v got the following piece of code:
try {
HttpClient httpClient = new DefaultHttpClient();
HttpPost httpPost = new HttpPost("http://www.flashstall.com/json.txt");
HttpResponse httpResponse = httpClient.execute(httpPost);
} catch (Exception e) {
Log.e("m40", "Error in http connection " + e.toString());
}
When I run it it logs "Error in http connection java.net.UnkownHostException: www.flashstall.com".
What am I doing wrong?