0
                    return null; 
                } 
 
                URL url = new URL("https://" + CAS_HOST + "/cas/rest/tickets/" + mTgtToken);
                conn = (HttpsURLConnection) url.openConnection();
                conn.setSSLSocketFactory(mSocketFactory);
                conn.setRequestMethod("POST");
                conn.setDoInput(true);
                conn.setDoOutput(true);
 
                List<NameValuePair> params = new ArrayList<NameValuePair>();
                params.add(new BasicNameValuePair("service", mAppName));
                String content = AuthUtils.getRequestParams(params);
                conn.setFixedLengthStreamingMode(content.getBytes("UTF-8").length);
 
                OutputStream out = conn.getOutputStream();
                BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(out, "UTF-8"));
                writer.write(content);
                writer.close();
                out.close();
 
                if (conn.getResponseCode() == 200) {
                    BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
 
                    String st = reader.readLine();
 
                    return st;
                } 
            } catch (Exception e) {
                e.printStackTrace();
            } finally { 
                if (conn != null) {
                    conn.disconnect();
                } 
            } 
 
            return null; 
        } 
Experience pair programming with AI  Get Codota for Java