日期:2014-05-20  浏览次数:20735 次

HttpClient怎么实现百度搜索
我用getMethod.setPath("http://www.baidu.com")可以得到正常的页面信息

但是用搜索加上参数的话
getMethod.setPath("http://www.baidu.com/s?wd=java")
就出错了,提示Invalid redirect location: http://www.baidu.com/search/error.html

------解决方案--------------------
有些http头要模拟成浏览器,如Reffer、User-Agent