您的位置:首页 > 理论基础 > 计算机网络

HttpClient:Target host must not be null, or set in parameters

2016-06-24 14:25 387 查看
HttpClient client = new DefaultHttpClient();  HttpGet get = new HttpGet("www.baidu.com");  HttpResponse response = client.execute(get); 抛出异常:Target host must not be null, or set in parameters原因是:url写法错误,需要加上http://解决办法:将" www.baidu.com "改为"http://www.baidu.com"
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: