Code examples for HttpsURLConnection

Codota analyzed 7,668,838 open source code samples to find the most common, credible and clear examples.
You can now enable Codota on your own code to easily search and navigate your Java codebase.
150:	connection.setSSLSocketFactory(context.getSocketFactory()); 
151:	connection.setRequestMethod(method); 
152:	connection.setRequestProperty("Content-Type", "application/json"); 
-
156:	connection.setRequestProperty("Authorization", getAuthorizationHeader()); 
Full Snippet Info
8
CodeRank
55:	connection.setRequestMethod("POST"); 
56:	connection.setDoInput(true); 
57:	connection.setDoOutput(true); 
58:	connection.setUseCaches(false); 
59:	connection.setRequestProperty(HTTP_FIELD_CONTENT_TYPE, CONTENT_TYPE_URLENCODED); 
60:	connection.setRequestProperty(HTTP_FIELD_CONTENT_LENGTH, String.valueOf(length)); 
Full Snippet Info
7
CodeRank
111:	conn.setSSLSocketFactory(clientSslFactory.createSSLSocketFactory()); 
112:	InputStream in = conn.getInputStream(); 
Full Snippet Info
7
CodeRank
75:	urlConnection.setSSLSocketFactory(sslContext.getSocketFactory()); 
76:	Log.i(TAG,"hostnameverifier is: " + urlConnection.getHostnameVerifier().getClass().getName()); 
-
78:	return urlConnection.getInputStream(); 
Full Snippet Info
7
CodeRank
121:	conn.setDoOutput(true); 
122:	conn.setRequestMethod("POST"); 
123:	conn.setRequestProperty("Content-Type", "application/json"); 
-
126:	OutputStream os = conn.getOutputStream(); 
-
130:	result = (long) conn.getResponseCode(); 
Full Snippet Info
6
CodeRank
266:	connect.setSSLSocketFactory(socketFactory); 
-
268:	connect.setRequestProperty("Authorization", authorization); 
-
270:	connect.setRequestMethod("POST"); 
271:	connect.setDoOutput(true); 
272:	connect.setRequestProperty("Content-Type", "text/xml; charset=utf-8"); 
273:	connect.setRequestProperty("Soapaction", ""); 
Full Snippet Info
6
CodeRank
139:	connection.setRequestMethod("POST"); 
-
141:	connection.setRequestProperty("Authorization", 
-
144:	connection.setDoOutput(true); 
-
147:	connection.setUseCaches(false); 
148:	connection.setAllowUserInteraction(false); 
149:	connection.setInstanceFollowRedirects(false); 
-
153:	connection.getOutputStream(), "UTF-8"); 
Full Snippet Info
6
CodeRank
58:	conn.setDoInput(true); 
-
62:	HTTPSCoder.configSSLSocketFactory(conn, password, keyStorePath, 
-
66:	int length = conn.getContentLength(); 
-
73:	DataInputStream dis = new DataInputStream(conn.getInputStream()); 
-
84:	conn.disconnect(); 
Full Snippet Info
6
CodeRank
80:	enabledCipherSuite = conn.getCipherSuite(); 
81:	localCertificates  = conn.getLocalCertificates(); 
82:	localPrincipal     = conn.getLocalPrincipal(); 
83:	serverCertificates = conn.getServerCertificates(); 
84:	peerPrincipal      = conn.getPeerPrincipal(); 
Full Snippet Info
6
CodeRank
214:	connection.setDoOutput(true); 
215:	connection.setFixedLengthStreamingMode(0); 
216:	connection.setRequestProperty("Content-Type", "text/json"); 
217:	OutputStreamWriter out = new OutputStreamWriter(connection.getOutputStream()); 
-
221:	InputStreamReader reader = new InputStreamReader(connection.getInputStream()); 
-
226:	connection.disconnect(); 
Full Snippet Info
6
CodeRank
58:	conn.setDoInput(true); 
-
62:	HTTPSCoder.configSSLSocketFactory(conn, password, keyStorePath, 
-
66:	int length = conn.getContentLength(); 
-
73:	DataInputStream dis = new DataInputStream(conn.getInputStream()); 
-
84:	conn.disconnect(); 
Full Snippet Info
6
CodeRank
44:	conn.setDoInput(true); 
45:	conn.setDoOutput(true); 
46:	conn.setUseCaches(false); 
47:	conn.setRequestMethod("POST"); 
48:	conn.setConnectTimeout(5000); 
49:	conn.setReadTimeout(10000); 
Full Snippet Info
6
CodeRank
81:	if (connection.getResponseCode() < 400) { //no error 
82:	inputStream = connection.getInputStream(); 
-
84:	inputStream = connection.getErrorStream(); 
Full Snippet Info
6
CodeRank
65:	http.setConnectTimeout(30 * 1000); 
66:	http.setReadTimeout(30 * 1000); 
67:	http.setUseCaches(false); 
68:	http.setDoInput(true); 
69:	http.setDoOutput(true); 
70:	http.setUseCaches(false); 
Full Snippet Info
6
CodeRank
55:	InputStream is = conn.getInputStream(); 
Full Snippet Info
5
CodeRank
75:	conn.setHostnameVerifier(new DummyHostnameVerifier()); 
Full Snippet Info
5
CodeRank
59:	huc.setSSLSocketFactory(factory); 
60:	huc.setHostnameVerifier(instance); 
Full Snippet Info
5
CodeRank