HttpsURLConnection Class

Definition

HttpsURLConnection extends HttpURLConnection with support for https-specific features.

[Android.Runtime.Register("javax/net/ssl/HttpsURLConnection", DoNotGenerateAcw=true)]
public abstract class HttpsURLConnection : Java.Net.HttpURLConnection
[<Android.Runtime.Register("javax/net/ssl/HttpsURLConnection", DoNotGenerateAcw=true)>]
type HttpsURLConnection = class
    inherit HttpURLConnection
Inheritance
Attributes

Remarks

HttpsURLConnection extends HttpURLConnection with support for https-specific features.

See http://www.w3.org/pub/WWW/Protocols/ and RFC 2818 for more details on the https specification.

This class uses HostnameVerifier and SSLSocketFactory. There are default implementations defined for both classes. However, the implementations can be replaced on a per-class (static) or per-instance basis. All new HttpsURLConnections instances will be assigned the "default" static values at instance creation, but they can be overriden by calling the appropriate per-instance set method(s) before connecting.

Added in 1.4.

Java documentation for javax.net.ssl.HttpsURLConnection.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Constructors

HttpsURLConnection(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

HttpsURLConnection(URL)

Creates an HttpsURLConnection using the URL specified.

Fields

HttpAccepted
Obsolete.

HTTP Status-Code 202: Accepted.

(Inherited from HttpURLConnection)
HttpBadGateway
Obsolete.

HTTP Status-Code 502: Bad Gateway.

(Inherited from HttpURLConnection)
HttpBadMethod
Obsolete.

HTTP Status-Code 405: Method Not Allowed.

(Inherited from HttpURLConnection)
HttpBadRequest
Obsolete.

HTTP Status-Code 400: Bad Request.

(Inherited from HttpURLConnection)
HttpClientTimeout
Obsolete.

HTTP Status-Code 408: Request Time-Out.

(Inherited from HttpURLConnection)
HttpConflict
Obsolete.

HTTP Status-Code 409: Conflict.

(Inherited from HttpURLConnection)
HttpCreated
Obsolete.

HTTP Status-Code 201: Created.

(Inherited from HttpURLConnection)
HttpEntityTooLarge
Obsolete.

HTTP Status-Code 413: Request Entity Too Large.

(Inherited from HttpURLConnection)
HttpForbidden
Obsolete.

HTTP Status-Code 403: Forbidden.

(Inherited from HttpURLConnection)
HttpGatewayTimeout
Obsolete.

HTTP Status-Code 504: Gateway Timeout.

(Inherited from HttpURLConnection)
HttpGone
Obsolete.

HTTP Status-Code 410: Gone.

(Inherited from HttpURLConnection)
HttpInternalError
Obsolete.

HTTP Status-Code 500: Internal Server Error.

(Inherited from HttpURLConnection)
HttpLengthRequired
Obsolete.

HTTP Status-Code 411: Length Required.

(Inherited from HttpURLConnection)
HttpMovedPerm
Obsolete.

HTTP Status-Code 301: Moved Permanently.

(Inherited from HttpURLConnection)
HttpMovedTemp
Obsolete.

HTTP Status-Code 302: Temporary Redirect.

(Inherited from HttpURLConnection)
HttpMultChoice
Obsolete.

HTTP Status-Code 300: Multiple Choices.

(Inherited from HttpURLConnection)
HttpNoContent
Obsolete.

HTTP Status-Code 204: No Content.

(Inherited from HttpURLConnection)
HttpNotAcceptable
Obsolete.

HTTP Status-Code 406: Not Acceptable.

(Inherited from HttpURLConnection)
HttpNotAuthoritative
Obsolete.

HTTP Status-Code 203: Non-Authoritative Information.

(Inherited from HttpURLConnection)
HttpNotFound
Obsolete.

HTTP Status-Code 404: Not Found.

(Inherited from HttpURLConnection)
HttpNotImplemented
Obsolete.

HTTP Status-Code 501: Not Implemented.

(Inherited from HttpURLConnection)
HttpNotModified
Obsolete.

HTTP Status-Code 304: Not Modified.

(Inherited from HttpURLConnection)
HttpOk
Obsolete.

HTTP Status-Code 200: OK.

(Inherited from HttpURLConnection)
HttpPartial
Obsolete.

HTTP Status-Code 206: Partial Content.

(Inherited from HttpURLConnection)
HttpPaymentRequired
Obsolete.

HTTP Status-Code 402: Payment Required.

(Inherited from HttpURLConnection)
HttpPreconFailed
Obsolete.

HTTP Status-Code 412: Precondition Failed.

(Inherited from HttpURLConnection)
HttpProxyAuth
Obsolete.

HTTP Status-Code 407: Proxy Authentication Required.

(Inherited from HttpURLConnection)
HttpReqTooLong
Obsolete.

HTTP Status-Code 414: Request-URI Too Large.

(Inherited from HttpURLConnection)
HttpReset
Obsolete.

HTTP Status-Code 205: Reset Content.

(Inherited from HttpURLConnection)
HttpSeeOther
Obsolete.

HTTP Status-Code 303: See Other.

(Inherited from HttpURLConnection)
HttpServerError
Obsolete.

HTTP Status-Code 500: Internal Server Error.

(Inherited from HttpURLConnection)
HttpUnauthorized
Obsolete.

HTTP Status-Code 401: Unauthorized.

(Inherited from HttpURLConnection)
HttpUnavailable
Obsolete.

HTTP Status-Code 503: Service Unavailable.

(Inherited from HttpURLConnection)
HttpUnsupportedType
Obsolete.

HTTP Status-Code 415: Unsupported Media Type.

(Inherited from HttpURLConnection)
HttpUseProxy
Obsolete.

HTTP Status-Code 305: Use Proxy.

(Inherited from HttpURLConnection)
HttpVersion
Obsolete.

HTTP Status-Code 505: HTTP Version Not Supported.

(Inherited from HttpURLConnection)

Properties

AllowUserInteraction

Returns the value of the allowUserInteraction field for this object. -or- Set the value of the allowUserInteraction field of this URLConnection.

(Inherited from URLConnection)
ChunkLength

The chunk-length when using chunked encoding streaming mode for output.

(Inherited from HttpURLConnection)
CipherSuite

Returns the name of the cipher suite negotiated during the SSL handshake.

Class

Returns the runtime class of this Object.

(Inherited from Object)
Connected

If false, this connection object has not created a communications link to the specified URL.

(Inherited from URLConnection)
ConnectTimeout

Returns setting for connect timeout. -or- Sets a specified timeout value, in milliseconds, to be used when opening a communications link to the resource referenced by this URLConnection.

(Inherited from URLConnection)
Content

Retrieves the contents of this URL connection.

(Inherited from URLConnection)
ContentEncoding

Returns the value of the content-encoding header field.

(Inherited from URLConnection)
ContentLength

Returns the value of the content-length header field.

(Inherited from URLConnection)
ContentLengthLong

Returns the value of the content-length header field as a long.

(Inherited from URLConnection)
ContentType

Returns the value of the content-type header field.

(Inherited from URLConnection)
Date

Returns the value of the date header field.

(Inherited from URLConnection)
DefaultHostnameVerifier

Gets the default HostnameVerifier that is inherited by new instances of this class. -or- Sets the default HostnameVerifier inherited by a new instance of this class.

DefaultSSLSocketFactory

Gets the default static SSLSocketFactory that is inherited by new instances of this class. -or- Sets the default SSLSocketFactory inherited by new instances of this class.

DefaultUseCaches

Returns the default value of a URLConnection's useCaches flag. -or- Sets the default value of the useCaches field to the specified value.

(Inherited from URLConnection)
DoInput

Returns the value of this URLConnection's doInput flag. -or- Sets the value of the doInput field for this URLConnection to the specified value.

(Inherited from URLConnection)
DoOutput

Returns the value of this URLConnection's doOutput flag. -or- Sets the value of the doOutput field for this URLConnection to the specified value.

(Inherited from URLConnection)
ErrorStream

Returns the error stream if the connection failed but the server sent useful data nonetheless.

(Inherited from HttpURLConnection)
Expiration

Returns the value of the expires header field.

(Inherited from URLConnection)
FixedContentLength

The fixed content-length when using fixed-length streaming mode.

(Inherited from HttpURLConnection)
FixedContentLengthLong

The fixed content-length when using fixed-length streaming mode.

(Inherited from HttpURLConnection)
Handle

The handle to the underlying Android instance.

(Inherited from Object)
HeaderFields

Returns an unmodifiable Map of the header fields.

(Inherited from URLConnection)
HostnameVerifier

Gets the HostnameVerifier in place on this instance. -or- Sets the HostnameVerifier for this instance.

IfModifiedSince

Returns the value of this object's ifModifiedSince field. -or- Sets the value of the ifModifiedSince field of this URLConnection to the specified value.

(Inherited from URLConnection)
InputStream

Returns an input stream that reads from this open connection.

(Inherited from URLConnection)
InstanceFollowRedirects

Returns the value of this HttpURLConnection's instanceFollowRedirects field. -or- Sets whether HTTP redirects (requests with response code 3xx) should be automatically followed by this HttpURLConnection instance.

(Inherited from HttpURLConnection)
JniIdentityHashCode (Inherited from Object)
JniPeerMembers
LastModified

Returns the value of the last-modified header field.

(Inherited from URLConnection)
LocalPrincipal

Returns the principal that was sent to the server during handshaking.

Method

The HTTP method (GET,POST,PUT,etc.

(Inherited from HttpURLConnection)
OutputStream

Returns an output stream that writes to this connection.

(Inherited from URLConnection)
PeerPrincipal

Returns the server's principal which was established as part of defining the session.

PeerReference (Inherited from Object)
Permission

Returns a permission object representing the permission necessary to make the connection represented by this object.

(Inherited from URLConnection)
ReadTimeout

Returns setting for read timeout. -or- Sets the read timeout to a specified timeout, in milliseconds.

(Inherited from URLConnection)
RequestMethod

Get the request method. -or- Set the method for the URL request, one of: <UL> <LI>GET <LI>POST <LI>HEAD <LI>OPTIONS <LI>PUT <LI>DELETE <LI>TRACE </UL> are legal, subject to protocol restrictions.

(Inherited from HttpURLConnection)
RequestProperties

Returns an unmodifiable Map of general request properties for this connection.

(Inherited from URLConnection)
ResponseCode

Gets the status code from an HTTP response message.

(Inherited from HttpURLConnection)
ResponseMessage

Gets the HTTP response message, if any, returned along with the response code from a server.

(Inherited from HttpURLConnection)
SSLSocketFactory

Gets the SSL socket factory to be used when creating sockets for secure https URL connections. -or- Sets the SSLSocketFactory to be used when this instance creates sockets for secure https URL connections.

ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Url

The URL represents the remote object on the World Wide Web to which this connection is opened.

(Inherited from URLConnection)
URL

Returns the value of this URLConnection's URL field.

(Inherited from URLConnection)
UseCaches

Returns the value of this URLConnection's useCaches field. -or- Sets the value of the useCaches field of this URLConnection to the specified value.

(Inherited from URLConnection)

Methods

AddRequestProperty(String, String)

Adds a general request property specified by a key-value pair.

(Inherited from URLConnection)
Clone()

Creates and returns a copy of this object.

(Inherited from Object)
Connect()

Opens a communications link to the resource referenced by this URL, if such a connection has not already been established.

(Inherited from URLConnection)
ConnectAsync() (Inherited from URLConnection)
Disconnect()

Indicates that other requests to the server are unlikely in the near future.

(Inherited from HttpURLConnection)
Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
GetContent(Class[])

Retrieves the contents of this URL connection.

(Inherited from URLConnection)
GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
GetHeaderField(Int32)

Returns the value for the n<sup>th</sup> header field.

(Inherited from URLConnection)
GetHeaderField(String)

Returns the value of the named header field.

(Inherited from URLConnection)
GetHeaderFieldDate(String, Int64)

Returns the value of the named field parsed as date.

(Inherited from URLConnection)
GetHeaderFieldInt(String, Int32)

Returns the value of the named field parsed as a number.

(Inherited from URLConnection)
GetHeaderFieldKey(Int32)

Returns the key for the n<sup>th</sup> header field.

(Inherited from URLConnection)
GetHeaderFieldLong(String, Int64)

Returns the value of the named field parsed as a number.

(Inherited from URLConnection)
GetLocalCertificates()

Returns the certificate(s) that were sent to the server during handshaking.

GetRequestProperty(String)

Returns the value of the named general request property for this connection.

(Inherited from URLConnection)
GetServerCertificates()

Returns the server's certificate chain which was established as part of defining the session.

JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
SetChunkedStreamingMode(Int32)

This method is used to enable streaming of a HTTP request body without internal buffering, when the content length is <b>not</b> known in advance.

(Inherited from HttpURLConnection)
SetFixedLengthStreamingMode(Int32)

This method is used to enable streaming of a HTTP request body without internal buffering, when the content length is known in advance.

(Inherited from HttpURLConnection)
SetFixedLengthStreamingMode(Int64)

This method is used to enable streaming of a HTTP request body without internal buffering, when the content length is known in advance.

(Inherited from HttpURLConnection)
SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
SetRequestProperty(String, String)

Sets the general request property.

(Inherited from URLConnection)
ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnregisterFromRuntime() (Inherited from Object)
UsingProxy()

Indicates if the connection is going through a proxy.

(Inherited from HttpURLConnection)
Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to