Code example for HttpsURLConnection

Methods: setRequestProperty

0
    } 
 
    private HttpsURLConnection setAuth(HttpsURLConnection conn, String handle, String pass) {
        String toEncode = handle + ":" + pass;
        String encoded = Base64.encodeToString(toEncode.getBytes(), Base64.DEFAULT);
        conn.setRequestProperty("Authorization", "Basic " + encoded);
 
        return conn;
    } 
 
    private HttpsURLConnection buildConnection(String method, String obj, String args) throws IOException {
        Pair<String, String> auth = new Pair<String, String>(this.handle, this.key);
        return this.buildConnection(method, obj, args, auth);
    } 
 
    private HttpsURLConnection buildConnection(String method, String obj, String args, Pair<String, String> auth) throws IOException {
        String sUrl;
 
        if (args == null || args.equals("")) {
            sUrl = this.urlFor(obj);
Connect your IDE to all the code out there  Get Codota for Java