out.println("pkcs10req=" + URLEncoder.encode(request) + "&user=" + URLEncoder.encode(username) + "&password=" + URLEncoder.encode(password) +
out.println("pkcs10req=" + URLEncoder.encode(request,"UTF-8") + "&user=" + URLEncoder.encode(username,"UTF-8") + "&password=" + URLEncoder.encode(password,"UTF-8") +
    public void sendHttpReq(String requestUrl, String request, String username, String password)        throws Exception {        log.debug(">sendHttpReq: request=" + request.toString() + ", username=" + username +            ", password=" + password);        if (requestUrl == null) {            throw new IllegalArgumentException("requesturl can not be  null.");        }        log.debug("Sending request to: " + requestUrl);        URL url = new URL(requestUrl);        HttpURLConnection con = (HttpURLConnection) getUrlConnection(url);        // we are going to do a POST        con.setDoOutput(true);        con.setRequestMethod("POST");        // POST it        PrintWriter out = new PrintWriter(con.getOutputStream());        out.println("pkcs10req=" + URLEncoder.encode(request) + "&user=" +            URLEncoder.encode(username) + "&password=" + URLEncoder.encode(password) +            "&submit=Submit+Query");        out.close();        // Read the reqponse        BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));        String inputLine;        while ((inputLine = in.readLine()) != null) {            System.out.println(inputLine);        }        if (con.getResponseCode() == 200) {            log.debug("Received certificate reply.");        } else {            throw new Exception("Error sending PKCS10-request.");        }        // We are done, disconnect        con.disconnect();        log.debug("<sendHttpReq:");    }