I'm trying to call a webservice with my application, but I get no error, the URL is the good one and return something (via the browser), but I get no content.
try {
HttpClient httpclient = new DefaultHttpClient();
HttpGet httpget = new HttpGet(url);
HttpResponse response = httpclient.execute(httpget);
HttpEntity entity = response.getEntity();
int lenght = (int) entity.getContentLength();
is = entity.getContent();
} catch (Exception e) {
Log.e("log_tag", "Error in http connection" + e.toString());
}
lenght is equal to -1 due to the empty response he receives
Does the response from the url need to be HTML ? Or anything I output can be grab by the HttpClient ?