标签:
String username = "foo"; String password = "bar"; String login = username + ":" + password; String base64login = new String(Base64.encodeBase64(login.getBytes())); Document document = Jsoup .connect("http://example.com") .header("Authorization", "Basic " + base64login) .get();
标签:
原文地址:http://www.cnblogs.com/leonxiaosi/p/4648769.html