I am trying to get a JSON file with an HTTP request:
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost(url);
HttpResponse response = httpclient.execute(httppost);
HttpEntity entity = response.getEntity();
is = entity.getContent();
I am getting a timeout exception on httpclient.execute
.
It isn't a URL problem because if I put it on browser it works fine. I am using xampp
and I already granted permissions to connect remotely.
I'm doing it with an asynchronous task too. It worked fine yesterday, today I tried again and it doesn't work anymore.
Replace localhost with xamp contained system's ip address in your url.