Popular Posts
jQuery Validation Engine default options Create web service client cross SSL with eclipse When creating web service cross SSL using eclipse, it occuss some error like below: And it can't build the client source from this wa... LitJSON (C#) & org.json.me (Java) LitJSON (C#) http://litjson.sourceforge.net/doc/manual.html#quickstart org.json.me (Java) http://www.json.org/java/index.html
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());
    }
});