api

http4k / org.http4k.core / HttpMessage

HttpMessage

interface HttpMessage : Closeable (source)

Properties

Name Summary
body abstract val body: Body
headers abstract val headers: Headers
version abstract val version: String

Functions

Name Summary
body abstract fun body(body: Body): HttpMessage
abstract fun body(body: String): HttpMessage
abstract fun body(body: InputStream, length: Long? = null): HttpMessage
bodyString open fun bodyString(): String
This will realise any underlying stream
close open fun close(): Unit
header open fun header(name: String): String?
abstract fun header(name: String, value: String?): HttpMessage
headers abstract fun headers(headers: Headers): HttpMessage
headerValues open fun headerValues(name: String): List<String?>
removeHeader abstract fun removeHeader(name: String): HttpMessage
replaceHeader abstract fun replaceHeader(name: String, value: String?): HttpMessage
toMessage abstract fun toMessage(): String

Companion Object Properties

Name Summary
HTTP_1_1 const val HTTP_1_1: String
HTTP_2 const val HTTP_2: String

Extension Functions

Name Summary
multipartIterator fun HttpMessage.multipartIterator(): Iterator<MultipartEntity>
with fun <T> T.with(vararg modifiers: (T) -> T): T

Inheritors

Name Summary
Request interface Request : HttpMessage
Response interface Response : HttpMessage