Popular Posts
Tomcat GET encoding edit server.xml : <Connector     URIEncoding="UTF-8"     connectionTimeout="20000"     port="8080"     prot... jQuery 1.4.3 API Cheat Sheet jQuery 1.4.3 API Cheat Sheet Dojo API CheatSheet Translating 2.0 <html> <head>     <title>Translation 2.0</title>     <meta http-equiv="content-type" content="text...
Stats
Sending Basic authentication using URL
URL url = new URL(“location address”);
URLConnection conn = url.openConnection();
String authorizationString = "Basic" + Base64.encode("username:password");
conn.setRequestProperty ("Authorization", authorizationString);
InputStream in = conn.getInputStream();
OR
Authenticator.setDefault (new Authenticator() {
    protected PasswordAuthentication getPasswordAuthentication() {
        return new PasswordAuthentication ("username", "password".toCharArray());
    }
});