Im trying to consume a restful service and im getting an error "Host name may not be null". Below is my exact code. If I copy and paste the url that im passing into this function into my browser I get results.
Thanks in advance for any help.
}
Thanks in advance for any help.
public
static void connect(String pUrl)
{
HttpClient client = new DefaultHttpClient();
HttpGet httpget = new HttpGet(pUrl);
String result=null;
HttpEntity entity = null;
HttpResponse response;
try {
response = client.execute(httpget);
} catch (Exception e) {
e.printStackTrace();
}
{
HttpClient client = new DefaultHttpClient();
HttpGet httpget = new HttpGet(pUrl);
String result=null;
HttpEntity entity = null;
HttpResponse response;
try {
response = client.execute(httpget);
} catch (Exception e) {
e.printStackTrace();
}
}