HttpResponse.PushPromise Method

Definition

Promotes a promised object.

Overloads

PushPromise(String)

Supports applications sending push promises to HTTP 2.0 clients. For more information, see HTTP/2 Specification Section 8.2: Server Push.

PushPromise(String, String, NameValueCollection)

Supports applications sending push promises to HTTP 2.0 clients. For more information, see HTTP/2 Specification Section 8.2: Server Push.

PushPromise(String)

Supports applications sending push promises to HTTP 2.0 clients. For more information, see HTTP/2 Specification Section 8.2: Server Push.

C#
public void PushPromise (string path);

Parameters

path
String

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.

Remarks

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.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

PushPromise(String, String, NameValueCollection)

Supports applications sending push promises to HTTP 2.0 clients. For more information, see HTTP/2 Specification Section 8.2: Server Push.

C#
public void PushPromise (string path, string method, System.Collections.Specialized.NameValueCollection headers);

Parameters

path
String

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 request method that would be used by the push request.

headers
NameValueCollection

Http request header that would be used by the push request.

Remarks

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.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1