HttpClient 403 Forbiddenn问题 模拟浏览器请求头
403 Forbiddenn问题 模拟浏览器请求头
重点配置如下:
// 创建http GET请求
HttpGet httpGet = new HttpGet(uri);
httpGet.setHeader("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3");