submitRequest

Submits HEADERS frame and optionally one or more DATA frames.

The |pri_spec| is priority specification of this request. To specify the priority, use PrioritySpec().

The pri_spec.weight must be in [MIN_WEIGHT, MAX_WEIGHT], inclusive. If pri_spec.weight is strictly less than MIN_WEIGHT, it becomes MIN_WEIGHT. If it is strictly greater than MAX_WEIGHT, it becomes MAX_WEIGHT.

The |hfa| is an array of header fields HeaderField with |hfa.length| elements. The application is responsible to include required pseudo-header fields (header field whose name starts with ":") in |hfa| and must place pseudo-headers before regular header fields.

This function creates copies of all header fields in |hfa|. It also lower-cases all names in |hfa|. The order of elements in |hfa| is preserved.

HTTP/2 specification has requirement about header fields in the request HEADERS. See the specification for more details.

If |data_prd| is not null, it provides data which will be sent in subsequent DATA frames. In this case, a method that allows request message bodies (http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9) must be specified with :method key in |hfa| (e.g. POST). This function does not take ownership of the |data_prd|. The function copies the members of the |data_prd|. If |data_prd| is null, HEADERS have END_STREAM set. The |stream_user_data| is data associated to the stream opened by this request and can be an arbitrary pointer, which can be retrieved later by getStreamUserData().

This function returns assigned stream ID if it succeeds, or one of the following negative error codes:

ErrorCode.STREAM_ID_NOT_AVAILABLE No stream ID is available because maximum stream ID was reached.

.. warning::

This function returns assigned stream ID if it succeeds. But that stream is not opened yet. The application must not submit a frame to that stream ID before Connector.onFrameReady is called for this frame.

Meta