HttpsURLConnection 類別

定義

HttpsURLConnection HttpURLConnection支援 https 專屬功能。

[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
繼承
屬性

備註

HttpsURLConnection HttpURLConnection支援 https 專屬功能。

欲了解更多 https 規範,請參閱 http://www.w3.org/pub/WWW/Protocols/ RFC 2818

此類別使用 HostnameVerifierSSLSocketFactory。 這兩種類別都有預設實作。 然而,這些實作可以依類別(靜態)或每個實例替換。 所有新的 HttpsURLConnections 實例在實例建立時都會被賦予「預設」靜態值,但可透過呼叫適當的每個實例集合方法來 connect覆寫這些值。

在 1.4 版本加入。

javax.net.ssl.HttpsURLConnectionJava 檔。

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

建構函式

名稱 Description
HttpsURLConnection(IntPtr, JniHandleOwnership)

用於建立 JNI 物件受管理表示的建構器;由執行時呼叫。

HttpsURLConnection(URL)

使用指定的網址建立一個 HttpsURLConnection

欄位

名稱 Description
HttpAccepted
已淘汰.

HTTP Status-Code 202:已接受。

(繼承來源 HttpURLConnection)
HttpBadGateway
已淘汰.

HTTP Status-Code 502:壞閘道器。

(繼承來源 HttpURLConnection)
HttpBadMethod
已淘汰.

HTTP Status-Code 405:不允許使用此方法。

(繼承來源 HttpURLConnection)
HttpBadRequest
已淘汰.

HTTP Status-Code 400:錯誤請求。

(繼承來源 HttpURLConnection)
HttpClientTimeout
已淘汰.

HTTP Status-Code 408:請求逾時。

(繼承來源 HttpURLConnection)
HttpConflict
已淘汰.

HTTP Status-Code 409:衝突。

(繼承來源 HttpURLConnection)
HttpCreated
已淘汰.

HTTP Status-Code 201:已建立。

(繼承來源 HttpURLConnection)
HttpEntityTooLarge
已淘汰.

HTTP Status-Code 413:請求實體過大。

(繼承來源 HttpURLConnection)
HttpForbidden
已淘汰.

HTTP Status-Code 403:禁止。

(繼承來源 HttpURLConnection)
HttpGatewayTimeout
已淘汰.

HTTP Status-Code 504:閘道逾時。

(繼承來源 HttpURLConnection)
HttpGone
已淘汰.

HTTP Status-Code 410:消失了。

(繼承來源 HttpURLConnection)
HttpInternalError
已淘汰.

HTTP Status-Code 500:內部伺服器錯誤。

(繼承來源 HttpURLConnection)
HttpLengthRequired
已淘汰.

HTTP Status-Code 411:需要長度。

(繼承來源 HttpURLConnection)
HttpMovedPerm
已淘汰.

HTTP Status-Code 301:永久移動。

(繼承來源 HttpURLConnection)
HttpMovedTemp
已淘汰.

HTTP Status-Code 302:臨時重定向。

(繼承來源 HttpURLConnection)
HttpMultChoice
已淘汰.

HTTP Status-Code 300:多選題。

(繼承來源 HttpURLConnection)
HttpNoContent
已淘汰.

HTTP Status-Code 204:無內容。

(繼承來源 HttpURLConnection)
HttpNotAcceptable
已淘汰.

HTTP Status-Code 406:不可接受。

(繼承來源 HttpURLConnection)
HttpNotAuthoritative
已淘汰.

HTTP Status-Code 203:非權威資訊。

(繼承來源 HttpURLConnection)
HttpNotFound
已淘汰.

HTTP Status-Code 404:未找到。

(繼承來源 HttpURLConnection)
HttpNotImplemented
已淘汰.

HTTP Status-Code 501:未實作。

(繼承來源 HttpURLConnection)
HttpNotModified
已淘汰.

HTTP Status-Code 304:未修改。

(繼承來源 HttpURLConnection)
HttpOk
已淘汰.

HTTP Status-Code 200:好的。

(繼承來源 HttpURLConnection)
HttpPartial
已淘汰.

HTTP Status-Code 206:部分內容。

(繼承來源 HttpURLConnection)
HttpPaymentRequired
已淘汰.

HTTP Status-Code 402:需付費。

(繼承來源 HttpURLConnection)
HttpPreconFailed
已淘汰.

HTTP Status-Code 412:前置條件失敗。

(繼承來源 HttpURLConnection)
HttpProxyAuth
已淘汰.

HTTP Status-Code 407:需要代理驗證。

(繼承來源 HttpURLConnection)
HttpReqTooLong
已淘汰.

HTTP Status-Code 414:Request-URI 太大。

(繼承來源 HttpURLConnection)
HttpReset
已淘汰.

HTTP Status-Code 205:重設內容。

(繼承來源 HttpURLConnection)
HttpSeeOther
已淘汰.

HTTP Status-Code 303:參見其他。

(繼承來源 HttpURLConnection)
HttpServerError
已淘汰.

HTTP Status-Code 500:內部伺服器錯誤。

(繼承來源 HttpURLConnection)
HttpUnauthorized
已淘汰.

HTTP Status-Code 401:未經授權。

(繼承來源 HttpURLConnection)
HttpUnavailable
已淘汰.

HTTP Status-Code 503:服務無法使用。

(繼承來源 HttpURLConnection)
HttpUnsupportedType
已淘汰.

HTTP Status-Code 415:不支援媒體類型。

(繼承來源 HttpURLConnection)
HttpUseProxy
已淘汰.

HTTP Status-Code 305:使用代理伺服器。

(繼承來源 HttpURLConnection)
HttpVersion
已淘汰.

HTTP Status-Code 505:HTTP 版本不支援。

(繼承來源 HttpURLConnection)

屬性

名稱 Description
AllowUserInteraction

回傳該物件欄位的 allowUserInteraction 值。 -或- 設定此allowUserInteraction域的值URLConnection

(繼承來源 URLConnection)
ChunkLength

使用區塊編碼串流模式作為輸出時的區塊長度。

(繼承來源 HttpURLConnection)
CipherSuite

回傳 SSL 握手時協商的密碼套件名稱。

Class

回傳此 Object的執行時類別。

(繼承來源 Object)
Connected

false,該連線物件尚未建立指向指定 URL 的通訊連結。

(繼承來源 URLConnection)
ConnectTimeout

回傳連線逾時設定。 -或- 設定一個指定的逾時值,單位為毫秒,用於開啟此 URLConnection 所參考資源的通訊連結。

(繼承來源 URLConnection)
Content

擷取此 URL 連線的內容。

(繼承來源 URLConnection)
ContentEncoding

回傳標頭欄位的 content-encoding 值。

(繼承來源 URLConnection)
ContentLength

回傳標頭欄位的 content-length 值。

(繼承來源 URLConnection)
ContentLengthLong

回傳標頭欄位的值 content-length 為 long。

(繼承來源 URLConnection)
ContentType

回傳標頭欄位的 content-type 值。

(繼承來源 URLConnection)
Date

回傳標頭欄位的 date 值。

(繼承來源 URLConnection)
DefaultHostnameVerifier

會取得這個類別新實例繼承的預設 HostnameVerifier 值。 -或- 設定該類別新實例繼承的預設 HostnameVerifier 值。

DefaultSSLSocketFactory

會取得這個類別新實例繼承的預設靜態 SSLSocketFactory 。 -或- 設定此類別新實例繼承的預設 SSLSocketFactory 值。

DefaultUseCaches

回傳 的預設值 URLConnectionuseCaches 旗標。 -或- 將欄位的預設值 useCaches 設為指定值。

(繼承來源 URLConnection)
DoInput

回傳此 URLConnectiondoInput 旗標值。 -或- 將該doInput欄位的值URLConnection設為指定的值。

(繼承來源 URLConnection)
DoOutput

回傳此 URLConnectiondoOutput 旗標值。 -或- 將該doOutput欄位的值URLConnection設為指定的值。

(繼承來源 URLConnection)
ErrorStream

如果連線失敗,但伺服器仍傳送有用資料,則回傳錯誤串流。

(繼承來源 HttpURLConnection)
Expiration

回傳標頭欄位的 expires 值。

(繼承來源 URLConnection)
FixedContentLength

使用固定長度串流模式時的固定內容長度。

(繼承來源 HttpURLConnection)
FixedContentLengthLong

使用固定長度串流模式時的固定內容長度。

(繼承來源 HttpURLConnection)
Handle

底層 Android 實例的帳號。

(繼承來源 Object)
HeaderFields

回傳一個不可修改的標頭欄位映射。

(繼承來源 URLConnection)
HostnameVerifier

這次就這樣 HostnameVerifier 安排好了。 -或- 為此實例設定 。HostnameVerifier

IfModifiedSince

回傳該物件 ifModifiedSince 欄位的值。 -或- 將此ifModifiedSince欄位的值URLConnection設為指定的值。

(繼承來源 URLConnection)
InputStream

回傳一個從此開放連接讀取的輸入串流。

(繼承來源 URLConnection)
InstanceFollowRedirects

回傳此HttpURLConnectioninstanceFollowRedirects欄位的值。 -或- 設定 HTTP 重定向(回應代碼為 3xx 的請求)是否應自動接續此 HttpURLConnection 實例。

(繼承來源 HttpURLConnection)
JniIdentityHashCode

取得由互通執行時指派給此 Java 對等端的身份雜湊碼。

(繼承來源 Object)
JniManagedPeerState

HttpsURLConnection HttpURLConnection支援 https 專屬功能。

(繼承來源 JavaObject)
JniPeerMembers

HttpsURLConnection HttpURLConnection支援 https 專屬功能。

LastModified

回傳標頭欄位的 last-modified 值。

(繼承來源 URLConnection)
LocalPrincipal

回傳握手時傳送給伺服器的主體。

Method

HTTP 方法(GET、POST、PUT 等)

(繼承來源 HttpURLConnection)
OutputStream

回傳一個寫入此連線的輸出串流。

(繼承來源 URLConnection)
PeerPrincipal

回傳伺服器的主體,該主體是定義會話的一部分。

PeerReference

取得這個 Java 節點的 JNI 物件參考。

(繼承來源 Object)
Permission

回傳一個權限物件,代表建立該物件所代表連線所需的權限。

(繼承來源 URLConnection)
ReadTimeout

回傳設定以進行讀取逾時。 -或- 將讀取逾時設定為指定的逾時,單位為毫秒。

(繼承來源 URLConnection)
RequestMethod

取得請求方式。 -或- 設定 URL 請求的方法,以下之一: <UL><LI>取得 <LI>後文 <LI>head <li>選項 <li>put <li>刪除 <li>trace </ul> 是合法的,但受協議限制。

(繼承來源 HttpURLConnection)
RequestProperties

回傳一個不可修改的一般請求屬性映射。

(繼承來源 URLConnection)
ResponseCode

從 HTTP 回應訊息取得狀態碼。

(繼承來源 HttpURLConnection)
ResponseMessage

會從伺服器回傳 HTTP 回應訊息(如有)及回應代碼。

(繼承來源 HttpURLConnection)
SSLSocketFactory

取得 SSL socket 工廠,以便在建立安全 https URL 連線的 socket 時使用。 -或- 設定 SSLSocketFactory 在建立安全 https URL 連接的 socket 時使用 。

ThresholdClass

此 API 支援適用於 Android 的 Mono 基礎結構,並不適合直接從您的程式代碼使用。

ThresholdType

此 API 支援適用於 Android 的 Mono 基礎結構,並不適合直接從您的程式代碼使用。

Url

該網址代表此連線所開啟的萬維網上遠端物件。

(繼承來源 URLConnection)
URL

回傳此URLConnectionURL欄位的值。

(繼承來源 URLConnection)
UseCaches

回傳此URLConnectionuseCaches欄位的值。 -或- 將此useCaches欄位的值URLConnection設為指定的值。

(繼承來源 URLConnection)

方法

名稱 Description
AddRequestProperty(String, String)

新增由鍵值對指定的一般請求屬性。

(繼承來源 URLConnection)
Clone()

建立並回傳此物件的副本。

(繼承來源 Object)
Connect()

若尚未建立該連結,將開啟指向該 URL 所引用資源的通訊連結。

(繼承來源 URLConnection)
ConnectAsync()

HttpsURLConnection HttpURLConnection支援 https 專屬功能。

(繼承來源 URLConnection)
Construct(JniObjectReference, JniObjectReferenceOptions)

HttpsURLConnection HttpURLConnection支援 https 專屬功能。

(繼承來源 JavaObject)
Disconnect()

表示近期內不太可能有其他請求。

(繼承來源 HttpURLConnection)
Dispose()

釋放該 Java 節點所持有的資源。

(繼承來源 Object)
Dispose(Boolean)

釋放該 Java 節點所持有的資源。

(繼承來源 Object)
DisposeUnlessReferenced()

HttpsURLConnection HttpURLConnection支援 https 專屬功能。

(繼承來源 JavaObject)
Equals(Object)

HttpsURLConnection HttpURLConnection支援 https 專屬功能。

(繼承來源 JavaObject)
Equals(Object)

表示是否有其他物體「等同」於此物。

(繼承來源 Object)
GetContent(Class[])

擷取此 URL 連線的內容。

(繼承來源 URLConnection)
GetHashCode()

回傳物件的雜湊碼值。

(繼承來源 Object)
GetHeaderField(Int32)

回傳 supnth</sup> 標頭欄位的<>值。

(繼承來源 URLConnection)
GetHeaderField(String)

回傳命名標頭欄位的值。

(繼承來源 URLConnection)
GetHeaderFieldDate(String, Int64)

回傳解析為日期的命名欄位值。

(繼承來源 URLConnection)
GetHeaderFieldInt(String, Int32)

回傳解析為數字後命名欄位的值。

(繼承來源 URLConnection)
GetHeaderFieldKey(Int32)

回傳 sup th/supn 標頭欄位的金鑰<>。<>

(繼承來源 URLConnection)
GetHeaderFieldLong(String, Int64)

回傳解析為數字後命名欄位的值。

(繼承來源 URLConnection)
GetLocalCertificates()

回傳握手時傳送給伺服器的憑證。

GetRequestProperty(String)

回傳此連線所命名的一般請求屬性的值。

(繼承來源 URLConnection)
GetServerCertificates()

回傳伺服器的憑證鏈,該鏈是定義會話時建立的。

JavaFinalize()

當垃圾回收判定該物件不再有相關參考時,由垃圾回收器呼叫。

(繼承來源 Object)
Notify()

喚醒一個正在該物件監視器上等待的執行緒。

(繼承來源 Object)
NotifyAll()

喚醒所有等待該物件監視器的執行緒。

(繼承來源 Object)
SetChunkedStreamingMode(Int32)

此方法用於在內容長度為 <b>not</b> 事先已知時,實現 HTTP 請求實體的串流,無需內部緩衝。

(繼承來源 HttpURLConnection)
SetFixedLengthStreamingMode(Int32)

此方法用於在事先已知內容長度的情況下,實現 HTTP 請求實體的串流而不需內部緩衝。

(繼承來源 HttpURLConnection)
SetFixedLengthStreamingMode(Int64)

此方法用於在事先已知內容長度的情況下,實現 HTTP 請求實體的串流而不需內部緩衝。

(繼承來源 HttpURLConnection)
SetHandle(IntPtr, JniHandleOwnership)

設定 Handle 屬性。

(繼承來源 Object)
SetPeerReference(JniObjectReference, JniObjectReferenceOptions)

HttpsURLConnection HttpURLConnection支援 https 專屬功能。

(繼承來源 JavaObject)
SetRequestProperty(String, String)

設定一般請求屬性。

(繼承來源 URLConnection)
ToArray<T>()

從這個 Java 陣列包裝器建立一個受管理陣列。

(繼承來源 Object)
ToString()

回傳物件的字串表示。

(繼承來源 Object)
UnregisterFromRuntime()

將此 Java 節點從互通執行時中取消註冊。

(繼承來源 Object)
UsingProxy()

顯示連線是否透過代理伺服器。

(繼承來源 HttpURLConnection)
Wait()

導致目前執行緒等待被喚醒,通常是透過 <em>通知</><em 或 em>中斷</em> 來喚醒。

(繼承來源 Object)
Wait(Int64, Int32)

會讓目前執行緒等待喚醒,通常是透過 <em>通知</><em 或 em>中斷</em>,或是經過一定的真實時間。

(繼承來源 Object)
Wait(Int64)

會讓目前執行緒等待喚醒,通常是透過 <em>通知</><em 或 em>中斷</em>,或是經過一定的真實時間。

(繼承來源 Object)

明確介面實作

名稱 Description
IJavaPeerable.Disposed()

HttpsURLConnection HttpURLConnection支援 https 專屬功能。

(繼承來源 JavaObject)
IJavaPeerable.Finalized()

HttpsURLConnection HttpURLConnection支援 https 專屬功能。

(繼承來源 JavaObject)
IJavaPeerable.JniObjectReferenceControlBlock

HttpsURLConnection HttpURLConnection支援 https 專屬功能。

(繼承來源 JavaObject)
IJavaPeerable.SetJniIdentityHashCode(Int32)

HttpsURLConnection HttpURLConnection支援 https 專屬功能。

(繼承來源 JavaObject)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates)

HttpsURLConnection HttpURLConnection支援 https 專屬功能。

(繼承來源 JavaObject)
IJavaPeerable.SetPeerReference(JniObjectReference)

HttpsURLConnection HttpURLConnection支援 https 專屬功能。

(繼承來源 JavaObject)

擴充方法

名稱 Description
GetJniTypeName(IJavaPeerable)

取得實例 self類型的 JNI 名稱。

JavaAs<TResult>(IJavaPeerable)

試著強制self輸入 TResult,檢查 強制在 Java 端是否有效。

JavaCast<TResult>(IJavaObject)

執行 Android 執行時檢查型別轉換。

JavaCast<TResult>(IJavaObject)

HttpsURLConnection HttpURLConnection支援 https 專屬功能。

TryJavaCast<TResult>(IJavaPeerable, TResult)

試著強制self輸入 TResult,檢查 強制在 Java 端是否有效。

適用於