当向 http://blahblahblah.com/site/Login/?domain=blahblahblah.com&request=[request string] 发送 GET 请求时,服务器总是响应 413 错误。在浏览器中,此请求显示带有 javascript 重定向的 html 页面。但是在 Jsoup 中获取这个 URL 的时候会抛出异常。我认为这是为了防止自动登录。我想得到响应的 html 宽度 Jsoup。
try{
Response response = Jsoup.connect("http://blahblahblah.com/site/Login/?domain=blahblahblah.com&request=abc123").method(Method.GET).execute();
}
catch (HttpStatusException e) {
//? What i must write here to get response
}
在 C#/.Net HttpWebRequest 异常对象中包含响应,我可以从中提取 html 数据。如何在java / android中做到这一点?
对不起我的英语不好。