Best code examples for Java 8 HttpsURLConnection class (javax.net.ssl.HttpsURLConnection)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 HttpsURLConnection class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Java 8 HttpsURLConnection examples from Open Source projects
This code example shows how to use the following methods: setRequestMethod, setRequestProperty, setSSLSocketFactory
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
This code example shows how to use the following methods: setRequestMethod, setDoInput, setDoOutput, setRequestProperty, setUseCaches
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
This code example shows how to use the following methods: getInputStream, setSSLSocketFactory
111:	conn.setSSLSocketFactory(clientSslFactory.createSSLSocketFactory()); 
112:	InputStream in = conn.getInputStream(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getInputStream, getHostnameVerifier, setSSLSocketFactory
75:	urlConnection.setSSLSocketFactory(sslContext.getSocketFactory()); 
76:	Log.i(TAG,"hostnameverifier is: " + urlConnection.getHostnameVerifier().getClass().getName()); 
-
78:	return urlConnection.getInputStream(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setInstanceFollowRedirects, setRequestMethod, getOutputStream, setAllowUserInteraction, setDoOutput
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
This code example shows how to use the following methods: setRequestMethod, setDoOutput, setRequestProperty, setSSLSocketFactory
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
This code example shows how to use the following methods: disconnect, setFixedLengthStreamingMode, getInputStream, getOutputStream, setDoOutput
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
This code example shows how to use the following methods: disconnect, getContentLength, getInputStream, setDoInput
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
This code example shows how to use the following methods: getCipherSuite, getLocalCertificates, getLocalPrincipal, getPeerPrincipal, getServerCertificates
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
This code example shows how to use the following methods: disconnect, getContentLength, getInputStream, setDoInput
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
This code example shows how to use the following methods: setRequestMethod, setConnectTimeout, setDoInput, setDoOutput, setReadTimeout
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
This code example shows how to use the following methods: getResponseCode, setRequestMethod, getOutputStream, setDoOutput, setRequestProperty
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
This code example shows how to use the following methods: getErrorStream, getResponseCode, getInputStream
81:	if (connection.getResponseCode() < 400) { //no error 
82:	inputStream = connection.getInputStream(); 
-
84:	inputStream = connection.getErrorStream(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setConnectTimeout, setDoInput, setDoOutput, setReadTimeout, setUseCaches
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
This code example shows how to use the following methods: getInputStream
55:	InputStream is = conn.getInputStream(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setHostnameVerifier
75:	conn.setHostnameVerifier(new DummyHostnameVerifier()); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setHostnameVerifier, setSSLSocketFactory
59:	huc.setSSLSocketFactory(factory); 
60:	huc.setHostnameVerifier(instance); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getResponseCode, setSSLSocketFactory
211:	connection.setSSLSocketFactory(clientContext.getSocketFactory()); 
212:	if (connection.getResponseCode() != 200) { 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: disconnect, getInputStream, setHostnameVerifier
56:	connection.setHostnameVerifier(new HostnameVerifier() { 
-
67:	connection.getInputStream(); 
68:	connection.disconnect(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setHostnameVerifier, setSSLSocketFactory
82:	huc.setSSLSocketFactory(sc.getSocketFactory()); 
83:	huc.setHostnameVerifier(ptm); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setDoInput, setDoOutput, setUseCaches
203:	connection.setUseCaches(false); 
204:	connection.setDoOutput(true); 
205:	connection.setDoInput(true); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getInputStream, setRequestProperty
35:	con.setRequestProperty("Authorization", "Basic " + new sun.misc.BASE64Encoder().encode (userPassword.getBytes())); 
-
37:	return con.getInputStream(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setRequestMethod, setRequestProperty
378:	con.setRequestMethod(method); 
379:	con.setRequestProperty("User-Agent", "CloudRAID"); 
380:	con.setRequestProperty("Accept", "*/*"); 
-
382:	con.setRequestProperty("Authorization", this.accessToken); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: disconnect, getURL
34:	java.net.URL url = realConnection.getURL(); 
-
36:	realConnection.disconnect(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getURL, setHostnameVerifier, setSSLSocketFactory
233:	connection.setSSLSocketFactory(sslContext.getSocketFactory()); 
234:	connection.setHostnameVerifier(NO_OP_HOSTNAME_VERIFIER); 
-
237:	+ connection.getURL() + "].", e); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getResponseCode, getResponseMessage, setFixedLengthStreamingMode, setRequestMethod, getOutputStream
291:	conn.setDoInput(true); 
292:	conn.setDoOutput(true); 
293:	conn.setRequestMethod("POST"); 
294:	conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded;charset=UTF-8"); 
295:	conn.setRequestProperty("Authorization", "Basic " + credentials); 
296:	conn.setFixedLengthStreamingMode(body.getBytes().length); 
-
299:	OutputStream out = new BufferedOutputStream(conn.getOutputStream()); 
-
303:	if (conn.getResponseCode() == HttpURLConnection.HTTP_OK) { 
-
310:	Log.e(LOG_TAG, "Http response code: " + conn.getResponseCode() + ", " + conn.getResponseMessage()); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getResponseCode, getResponseMessage, getURL
170:	int code = connection.getResponseCode(); 
171:	URL url = connection.getURL(); 
172:	String msg = connection.getResponseMessage(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getResponseCode, setRequestMethod, connect
434:	connection.setRequestMethod("GET"); 
435:	connection.connect(); 
436:	int code = connection.getResponseCode(); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: getResponseCode, getInputStream, setHostnameVerifier
154:	con.setHostnameVerifier(DO_NOT_VERIFY); 
155:	int statusCode = con.getResponseCode(); 
-
160:	https_is = con.getInputStream(); 
-
166:	con.setHostnameVerifier(new HostnameVerifier() { 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: disconnect, getResponseCode, setFixedLengthStreamingMode, setRequestMethod, getInputStream
177:	conn.setSSLSocketFactory(mSocketFactory); 
178:	conn.setRequestMethod("POST"); 
179:	conn.setDoInput(true); 
180:	conn.setDoOutput(true); 
-
185:	conn.setFixedLengthStreamingMode(content.getBytes("UTF-8").length); 
-
187:	OutputStream out = conn.getOutputStream(); 
-
193:	if (conn.getResponseCode() == 200) { 
194:	BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream())); 
-
204:	conn.disconnect(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setHostnameVerifier, setSSLSocketFactory
82:	huc.setSSLSocketFactory(sc.getSocketFactory()); 
83:	huc.setHostnameVerifier(ptm); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setHostnameVerifier, setSSLSocketFactory
59:	huc.setSSLSocketFactory(factory); 
60:	huc.setHostnameVerifier(instance); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getResponseCode, getInputStream
161:	int resp = connection.getResponseCode(); 
-
164:	InputStream s = connection.getInputStream(); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: setHostnameVerifier, setSSLSocketFactory
256:	sslConn.setSSLSocketFactory(createSSLSocketFactory()); 
-
260:	sslConn.setHostnameVerifier(getHostnameVerifier()); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: getPeerPrincipal
43:	con.getPeerPrincipal(); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: setHostnameVerifier
88:	conn.setHostnameVerifier(hostnameVerifier); 
-
90:	setConnection(conn); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: getInputStream
58:	InputStream is = conn.getInputStream(); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: setHostnameVerifier, setSSLSocketFactory
154:	httpsConnection.setHostnameVerifier(simpleNameVerifier); 
-
161:	httpsConnection.setSSLSocketFactory(sslContext.getSocketFactory()); 
Full Snippet Info
4
CodeRank
Related Java 8 HttpsURLConnection Questions & Answers:
See Code Examples for Java 8 HttpsURLConnection Methods: