submitHeaders

Submits HEADERS frame. The |flags| is bitwise OR of the following values:

* FrameFlags.END_STREAM

If |flags| includes FrameFlags.END_STREAM, this frame has END_STREAM flag set.

The library handles the CONTINUATION frame internally and it correctly sets END_HEADERS to the last sequence of the PUSH_PROMISE or CONTINUATION frame.

If the |stream_id| is -1, this frame is assumed as request (i.e., request HEADERS frame which opens new stream). In this case, the assigned stream ID will be returned. Otherwise, specify stream ID in |stream_id|.

The |pri_spec| is priority specification of this request. init means the default priority. To specify the priority, use PrioritySpec constructor.

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.

The |stream_user_data| is a pointer to an arbitrary data which is associated to the stream this frame will open. Therefore it is only used if this frame opens streams, in other words, it changes stream state from idle or reserved to open.

This function is low-level in a sense that the application code can specify flags directly. For usual HTTP request, submitRequest() is useful.

This function returns newly assigned stream ID if it succeeds and |stream_id| is -1. Otherwise, this function returns 0 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. ErrorCode.INVALID_ARGUMENT The |stream_id| is 0.

.. warning::

This function returns assigned stream ID if it succeeds and |stream_id| is -1. But that stream is not opened yet. The application must not submit frame to that stream ID before Connector.onFrameHeader is called for this frame.

int
submitHeaders

Meta