HttpResponse.PushPromise 方法

定義

提升承諾的物件。Promotes a promised object.

多載

PushPromise(String)

支援傳送推送 Promise 給 HTTP 2.0 用戶端的應用程式。Supports applications sending push promises to HTTP 2.0 clients. 如需詳細資訊,請參閱 HTTP/2 Specification Section 8.2:Server Push (HTTP/2 規格第 8.2 節:伺服器推送。For more information, see HTTP/2 Specification Section 8.2: Server Push.

PushPromise(String, String, NameValueCollection)

支援傳送推送 Promise 給 HTTP 2.0 用戶端的應用程式。Supports applications sending push promises to HTTP 2.0 clients. 如需詳細資訊,請參閱 HTTP/2 Specification Section 8.2:Server Push (HTTP/2 規格第 8.2 節:伺服器推送。For more information, see HTTP/2 Specification Section 8.2: Server Push.

PushPromise(String)

支援傳送推送 Promise 給 HTTP 2.0 用戶端的應用程式。Supports applications sending push promises to HTTP 2.0 clients. 如需詳細資訊,請參閱 HTTP/2 Specification Section 8.2:Server Push (HTTP/2 規格第 8.2 節:伺服器推送。For more information, see HTTP/2 Specification Section 8.2: Server Push.

public:
 void PushPromise(System::String ^ path);
public void PushPromise (string path);
member this.PushPromise : string -> unit
Public Sub PushPromise (path As String)

參數

path
String

推播要求的 URL。The URL of the push request. 它應為伺服器想要推送到用戶端之相對資源的虛擬路徑。It should be the virtual path of the relative resource that the server wants to push to the client.

備註

PushPromise 是不具決定性的,且應用程式不應該有相依的邏輯。PushPromise is non-deterministic, and applications shouldn't have logic that depends on it. 在某些情況下,其唯一的用途是效能優勢。Its only purpose is performance advantage in some cases. 有許多條件 (通訊協定和執行) 可能會導致推送要求被忽略。There are many conditions (protocol and implementation) that may cause push requests to be ignored. 預期是以火災和遺忘為基礎。The expectation is based on fire-and-forget.

適用於

PushPromise(String, String, NameValueCollection)

支援傳送推送 Promise 給 HTTP 2.0 用戶端的應用程式。Supports applications sending push promises to HTTP 2.0 clients. 如需詳細資訊,請參閱 HTTP/2 Specification Section 8.2:Server Push (HTTP/2 規格第 8.2 節:伺服器推送。For more information, see HTTP/2 Specification Section 8.2: Server Push.

public:
 void PushPromise(System::String ^ path, System::String ^ method, System::Collections::Specialized::NameValueCollection ^ headers);
public void PushPromise (string path, string method, System.Collections.Specialized.NameValueCollection headers);
member this.PushPromise : string * string * System.Collections.Specialized.NameValueCollection -> unit
Public Sub PushPromise (path As String, method As String, headers As NameValueCollection)

參數

path
String

推播要求的 URL。The URL of the push request. 它應為伺服器想要推送到用戶端之相對資源的虛擬路徑。It should be the virtual path of the relative resource that the server wants to push to the client.

method
String

推播要求要使用的 HTTP 要求方法。Http request method that would be used by the push request.

headers
NameValueCollection

推播要求要使用的 HTTP 要求標頭。Http request header that would be used by the push request.

備註

PushPromise 是不具決定性的,且應用程式不應該有相依的邏輯。PushPromise is non-deterministic, and applications shouldn't have logic that depends on it. 在某些情況下,其唯一的用途是效能優勢。Its only purpose is performance advantage in some cases. 有許多條件 (通訊協定和執行) 可能會導致推送要求被忽略。There are many conditions (protocol and implementation) that may cause push requests to be ignored. 預期是以火災和遺忘為基礎。The expectation is based on fire-and-forget.

適用於