• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Restful client question

bliink

Lurker
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.

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();
}

}
 
Back
Top Bottom