Java javax.net.ssl HttpsURLConnection fields, constructors, methods, implement or subclass

Example usage for Java javax.net.ssl HttpsURLConnection fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for javax.net.ssl HttpsURLConnection.

The text is from its open source code.

Method

voidaddRequestProperty(String key, String value)
Adds a general request property specified by a key-value pair.
voidconnect()
Opens a communications link to the resource referenced by this URL, if such a connection has not already been established.
voiddisconnect()
Indicates that other requests to the server are unlikely in the near future.
StringgetCipherSuite()
Returns the cipher suite in use on this connection.
intgetConnectTimeout()
Returns setting for connect timeout.
ObjectgetContent()
Retrieves the contents of this URL connection.
StringgetContentEncoding()
Returns the value of the content-encoding header field.
intgetContentLength()
Returns the value of the content-length header field.
longgetContentLengthLong()
Returns the value of the content-length header field as a long.
StringgetContentType()
Returns the value of the content-type header field.
HostnameVerifiergetDefaultHostnameVerifier()
Gets the default HostnameVerifier that is inherited by new instances of this class.
SSLSocketFactorygetDefaultSSLSocketFactory()
Gets the default static SSLSocketFactory that is inherited by new instances of this class.
booleangetDoOutput()
Returns the value of this URLConnection 's doOutput flag.
InputStreamgetErrorStream()
Returns the error stream if the connection failed but the server sent useful data nonetheless.
StringgetHeaderField(int n)
Returns the value for the n th header field.
StringgetHeaderFieldKey(int n)
Returns the key for the n th header field.
Map>getHeaderFields()
Returns an unmodifiable Map of the header fields.
HostnameVerifiergetHostnameVerifier()
Gets the HostnameVerifier in place on this instance.
InputStreamgetInputStream()
Returns an input stream that reads from this open connection.
java.security.cert.Certificate[]getLocalCertificates()
Returns the certificate(s) that were sent to the server during handshaking.
OutputStreamgetOutputStream()
Returns an output stream that writes to this connection.
intgetReadTimeout()
Returns setting for read timeout.
StringgetRequestMethod()
Get the request method.
Map>getRequestProperties()
Returns an unmodifiable Map of general request properties for this connection.
StringgetRequestProperty(String key)
Returns the value of the named general request property for this connection.
intgetResponseCode()
Gets the status code from an HTTP response message.
StringgetResponseMessage()
Gets the HTTP response message, if any, returned along with the response code from a server.
java.security.cert.Certificate[]getServerCertificates()
Returns the server's certificate chain which was established as part of defining the session.
SSLSocketFactorygetSSLSocketFactory()
Gets the SSL socket factory to be used when creating sockets for secure https URL connections.
URLgetURL()
Returns the value of this URLConnection 's URL field.
voidsetAllowUserInteraction(boolean allowuserinteraction)
Set the value of the allowUserInteraction field of this URLConnection .
voidsetChunkedStreamingMode(int chunklen)
This method is used to enable streaming of a HTTP request body without internal buffering, when the content length is not known in advance.
voidsetConnectTimeout(int timeout)
Sets a specified timeout value, in milliseconds, to be used when opening a communications link to the resource referenced by this URLConnection.
voidsetDefaultHostnameVerifier(HostnameVerifier v)
Sets the default HostnameVerifier inherited by a new instance of this class.
voidsetDefaultSSLSocketFactory(SSLSocketFactory sf)
Sets the default SSLSocketFactory inherited by new instances of this class.
voidsetDefaultUseCaches(boolean defaultusecaches)
Sets the default value of the useCaches field to the specified value.
voidsetDoInput(boolean doinput)
Sets the value of the doInput field for this URLConnection to the specified value.
voidsetDoOutput(boolean dooutput)
Sets the value of the doOutput field for this URLConnection to the specified value.
voidsetFixedLengthStreamingMode(int contentLength)
This method is used to enable streaming of a HTTP request body without internal buffering, when the content length is known in advance.
voidsetHostnameVerifier(HostnameVerifier v)
Sets the HostnameVerifier for this instance.
voidsetInstanceFollowRedirects(boolean followRedirects)
Sets whether HTTP redirects (requests with response code 3xx) should be automatically followed by this HttpURLConnection instance.
voidsetReadTimeout(int timeout)
Sets the read timeout to a specified timeout, in milliseconds.
voidsetRequestMethod(String method)
Set the method for the URL request, one of:
  • GET
  • POST
  • HEAD
  • OPTIONS
  • PUT
  • DELETE
  • TRACE
are legal, subject to protocol restrictions.
voidsetRequestProperty(String key, String value)
Sets the general request property.
voidsetSSLSocketFactory(SSLSocketFactory sf)
Sets the SSLSocketFactory to be used when this instance creates sockets for secure https URL connections.
voidsetUseCaches(boolean usecaches)
Sets the value of the useCaches field of this URLConnection to the specified value.
StringtoString()
Returns a String representation of this URL connection.