Implement the PushPromise api as virtual NoOp in the abstract class HttpResponse.
This API is to support applications sending push promises to HTTP 2.0 clients.
Current .NET v4.6 Api
public void PushPromise( string path )
public void PushPromise(
path Type: System.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 Type: System.String
Http request method that would be used by the push request.
headers Type: System.Collections.Specialized.NameValueCollection
Http request header that would be used by the push request.
Suggested addition to Microsoft.AspNet.Http.Abstractions/HttpResponse.cs
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 to ignore the push requests completely. The expectation is based on fire-and-forget.
Its out-of-band data like headers and cookies and is part of the response so should live at the HttpResponse level.
It is a core feature of http/2 rather than a extended addition that might be HttpContext related.
Its now standardised and implemented in all browsers - so is something I assume will be implemented in ASP.NET 5.
It already comes with two huge caveats:
Which means it doesn't actually have to do anything at this time.
public virtual void PushPromise(string path);
public virtual void PushPromise(string path, string method, IHeaderDictionary headers);
Additional protocol activation background
In light of this it looks like http/2 is a defacto https only protocol; so PushPromise will only need to work over https and http/2 at this time.
As per previous discussion, we'll look into HTTP/2 after RTM.
Related API questions:
Backlogging this one. cc @DamianEdwards