Code example for HttpsURLConnection

Methods: setRequestMethodsetDoOutputsetRequestPropertysetSSLSocketFactory

0
            throw new DataBoxException(message);
        } 
    } 
 
    private void configure(HttpsURLConnection connect) throws ProtocolException {
        connect.setSSLSocketFactory(socketFactory);
        // connect.setRequestProperty("Authorization", authorization); 
        connect.setRequestProperty("Authorization", authorization);
        // connect.setRequestProperty("Cookie", authCookie); 
        connect.setRequestMethod("POST");
        connect.setDoOutput(true);
        connect.setRequestProperty("Content-Type", "text/xml; charset=utf-8");
        connect.setRequestProperty("Soapaction", "");
    } 
 
    private void close(HttpsURLConnection con) {
        if (con != null) {
            con.disconnect();
        } 
    }