Lines Matching refs:conn
51 HttpURLConnection conn = openConnection(url, authType, proxy);
52 configure(conn, auth);
53 System.out.println("Response code: " + conn.getResponseCode());
54 String result = new String(conn.getInputStream().readAllBytes(), "UTF-8");
60 conn = openConnection(url, authType, proxy);
61 configure(conn, auth);
62 conn.setRequestMethod("POST");
63 conn.setDoOutput(true);
64 conn.setDoInput(true);
65 conn.getOutputStream().write("Hello World!".getBytes("UTF-8"));
66 System.out.println("Response code: " + conn.getResponseCode());
67 result = new String(conn.getInputStream().readAllBytes(), "UTF-8");
76 private static void configure(HttpURLConnection conn, Authenticator auth)
79 conn.setAuthenticator(auth);
81 if (conn instanceof HttpsURLConnection) {
85 // HttpsURLConnection httpsConn = (HttpsURLConnection)conn;