Skip to main content

//clika-runtime/io.clika.runtime/HttpResponse

HttpResponse

[common]
class HttpResponse

A finished HTTP response, the outcome of a request the server answered: any answered status arrives here as data (a 404 or a 401 too; branch on status or isOk); only a request that could not complete at all (the connection, TLS, a timeout, a cancellation) fails with a ClikaRtException. headers keep the arrival order and a name may repeat; body is empty for a transfer that streamed its body to a file.

Properties​

NameSummary
body[common]
val body: ByteArray
headers[common]
val headers: List<<Error class: unknown class><String, String>>
The response headers as name / value pairs, in arrival order.
isOk[common]
val isOk: Boolean
True for a 2xx status.
reason[common]
val reason: String
status[common]
val status: Int

Functions​

NameSummary
header[common]
fun header(name: String): String?
The first value of header name, matched without regard to case, or null.
text[common]
fun text(): String
The body decoded as UTF-8 text.