Scoop API

scoop:scoop.http:0.1.0

Http1Encoder

class Http1Encoder

source · line 42
public
public class Http1Encoder public constructor(
    /**
     * The fixed client/server role of this codec.
     */
    public val role: HttpRole
) : Closeable

An HTTP/1 encoder with explicit message begin, body, and finish. It produces framing bytes without performing transport I/O; close does not finish a message.

property role

source · line 46
public
public val role: HttpRole

get: public read-only

The fixed client/server role of this codec.

function prepareBody

source · line 218
public
public fun prepareBody(count: Long): Http1BodyChunk

Accepts a body length and returns only its surrounding framing. The caller emits prefix, its original payload, then suffix; a failed transmission must not retry this accepted chunk.

function close

source · line 286
public
public override fun close(): Unit

Releases codec state without sending, finishing, or closing a transport.

function beginResponse

source · line 141
public
public fun beginResponse(head: HttpResponseHead, requestMethod: List<Byte>, body: Http1BodyFraming = Http1BodyFraming.Empty): Array<Byte>

Encodes a server response using the exact originating method to determine body and switching rules. Returned bytes are immutable and remain valid across later messages and close.