Java code:
try {
// defaultHttpClient
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpGet httpGet = new HttpGet(url);
HttpResponse httpResponse =httpClient.execute(httpGet);
HttpEntity httpEntity = httpResponse.getEntity();
is = httpEntity.getContent();
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
} catch (ClientProtocolException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
where url is like:
http://122.180.133.121:84/diogo/api/api.php?class=authenticate&method=login_check¶m={'userpassword':'777','username':'www'}
and logcat error is:
java.lang.IllegalStateException: Target host must not be null, or set in parameters. scheme=null, host=null, path=http://122.170.103.168:86/diogo/api/api.php?class=authenticate&method=login_check¶m={'userpassword':'123','username':'krunal'}
I already searched many solutions but all are saying about http or www.. but i dont know what is the actual problem. is just because of my server ip address or what.?