加上这句就ok了
inal String url = strings[0];
//得到httpclient对象
DefaultHttpClient client = new DefaultHttpClient();
//封装get请求
HttpGet hg=new HttpGet(url);
//获取返回的response
try {
//修改org.apache.http的主机名验证解决问题
SSLSocketFactory.getSocketFactory().setHostnameVerifier(new AllowAllHostnameVerifier());
HttpResponse response = client.execute(hg);
//获取状态码
int statusCode = response.getStatusLine().getStatusCode();
if(statusCode==200){
//entiry 里面封装的数据;
HttpEntity entity = response.getEntity();
//这个result就是json字符串,剩下的就是解析工作了;
String s = EntityUtils.toString(entity);
return s;
}