oschina 的登录代码 ,为什么获取不到cookie

开源oschina 发布于 2014/09/30 15:55
阅读 108
收藏 0
Map<String , String> datamap=new HashMap<String, String>();
datamap.put("email", "账号");
datamap.put("pwd", "密码");
datamap.put("verifyCode", "");
datamap.put("save_login", "1");
Connection connection = Jsoup.connect("https://www.oschina.net/action/user/hash_login").userAgent("Mozilla/5.0 (Windows NT 6.1; rv:26.0) Gecko/20100101 Firefox/26.0")
.data(datamap);
connection.method(Method.POST);
connection.followRedirects(true); 
Response response= connection.execute();

System.out.println(response.cookies());
加载中
返回顶部
顶部