method

quic.QuicStream.sendHeaders

headers: Dict<string | string[]>,
): boolean;

Sends initial or response headers on the stream. For client-side streams, this sends request headers. For server-side streams, this sends response headers. Throws ERR_INVALID_STATE if the session does not support headers.

@param headers

Header object with string keys and string or string-array values. Pseudo-headers (:method, :path, etc.) must appear before regular headers.

Referenced types

interface StreamSendHeadersOptions

  • terminal?: boolean

    If true, the stream is closed for sending after the headers (no body will follow). Default: false.