HTTP timeout exception

109 Views Asked by At

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.

1

There are 1 best solutions below

0
On

Replace localhost with xamp contained system's ip address in your url.