Interface PushBuilder


@Deprecated public interface PushBuilder
Deprecated.
In favor of 103 early hints
Build a request to be pushed. According section 8.2 of RFC 7540, a promised request must be cacheable and safe without a request body.

A PushBuilder is obtained by calling HttpServletRequest.newPushBuilder(). Each call to this method will a new instance of a PushBuilder based off the current HttpServletRequest, or null. Any mutations to the returned PushBuilder are not reflected on future returns.

The instance is initialized as follows:

The path(java.lang.String) method must be called on the PushBuilder instance before the call to push(). Failure to do so must cause an exception to be thrown from push(), as specified in that method.

A PushBuilder can be customized by chained calls to mutator methods before the push() method is called to initiate an asynchronous push request with the current state of the builder. After the call to push(), the builder may be reused for another push, however the implementation must make it so the path(String) and conditional headers (defined in RFC 7232) values are cleared before returning from push(). All other values are retained over calls to push().

Since:
Servlet 4.0