api

http4k / org.http4k.core / Response

Response

interface Response : HttpMessage

Properties

Name Summary
status abstract val status: Status

Functions

Name Summary
body (Copy &) sets the body content.abstract fun body(body: Body): Response
abstract fun body(body: String): Response
abstract fun body(body: InputStream, length: Long?): Response
header (Copy &) Adds a header value with this name.abstract fun header(name: String, value: String?): Response
headers (Copy &) Add all passed headers.abstract fun headers(headers: Headers): Response
removeHeader (Copy &) remove headers with this name.abstract fun removeHeader(name: String): Response
replaceHeader (Copy &) Adds a header value with this name, replacing any previously set values.abstract fun replaceHeader(name: String, value: String?): Response
replaceHeaders Replace all headers with ones passed.abstract fun replaceHeaders(source: Headers): Response
status abstract fun status(new: Status): Response
toMessage Returns a formatted wire representation of this message.open fun toMessage(): String

Companion Object Functions

Name Summary
invoke operator fun invoke(status: Status, version: String = HTTP_1_1): Response

Extension Functions

Name Summary
alphabetiseHeaders fun <T : HttpMessage> T.alphabetiseHeaders(): T
cookie fun Response.cookie(cookie: Cookie): Response
cookies fun Response.cookies(): List<Cookie>
invalidateCookie fun Response.invalidateCookie(name: String, domain: String? = null): Response
maxAge fun Response.maxAge(duration: Duration): Response
multipartIterator fun HttpMessage.multipartIterator(): Iterator<MultipartEntity>
mustRevalidate fun Response.mustRevalidate(): Response
noCache fun Response.noCache(): Response
noStore fun Response.noStore(): Response
onlyIfCached fun Response.onlyIfCached(): Response
private fun Response.private(): Response
public fun Response.public(): Response
removeCookie fun Response.removeCookie(name: String): Response
replaceCookie fun Response.replaceCookie(cookie: Cookie): Response
staleIfError fun Response.staleIfError(duration: Duration): Response
staleWhileRevalidate fun Response.staleWhileRevalidate(duration: Duration): Response
with fun <T : HttpMessage> T.with(vararg modifiers: (T) -> T): T

Companion Object Extension Functions

Name Summary
parse fun Response.Companion.parse(response: String): Response

Inheritors

Name Summary
MemoryResponse data class MemoryResponse : Response
RoutedResponse class RoutedResponse : Response