RequestResponseBuilder

class RequestResponseBuilder

Builds an HTTP request or response

Constructors

<init>

RequestResponseBuilder()

Builds an HTTP request or response

Functions

build

fun build(): ByteReadPacket

Build a packet of request/response

bytes

fun bytes(
    content: ByteArray,
    offset: Int = 0,
    length: Int = content.size
): Unit
fun bytes(content: ByteBuffer): Unit

Append raw bytes

emptyLine

fun emptyLine(): Unit

Append an empty line (CR + LF in fact)

headerLine

fun headerLine(name: CharSequence, value: CharSequence): Unit

Append header line

line

fun line(line: CharSequence): Unit

Append a line

release

fun release(): Unit

Release all resources hold by the builder

requestLine

fun requestLine(
    method: HttpMethod,
    uri: CharSequence,
    version: CharSequence
): Unit

Append request line

responseLine

fun responseLine(
    version: CharSequence,
    status: Int,
    statusText: CharSequence
): Unit

Append response status line