问一个关于httpclient 的问题。。。
为什么返回html是登陆页面,完全没有发出去的感觉
代码:
HttpPost post = new HttpPost("http://www.homevv.com/vvshopNeedLogin.jhtml?");
List<NameValuePair> nvps = new ArrayList<NameValuePair>();
nvps.add(new BasicNameValuePair("loginId", "xxxxxx"));
nvps.add(new BasicNameValuePair("password", "xxxxxx"));
nvps.add(new BasicNameValuePair("rememberMe", "true"));
post.setEntity(new UrlEncodedFormEntity(nvps, HTTP.UTF_8));
HttpResponse response = httpclient.execute(post);
String strResult=EntityUtils.toString(response.getEntity());
System.out.println(strResult);
还有最新的4.3X怎么设置带用户名密码的代理的公司走的外线之前的代码不能用了!
httpClient.getCredentialsProvider().setCredentials 这个方法不见了!