---
title: "HttpResponse"
sidebar_label: "HttpResponse"
description: "Kotlin binding reference: HttpResponse."
---

<!-- Generated by tools/api_reference/generate_api_docs.py. Do not edit. -->

//[clika-runtime](../../../index.md)/[io.clika.runtime](../index.md)/[HttpResponse](index.md)

# HttpResponse

[common]\
class [HttpResponse](index.md)

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

## Properties

| Name | Summary |
|---|---|
| [body](body.md) | [common]<br>val [body](body.md): [ByteArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html) |
| [headers](headers.md) | [common]<br>val [headers](headers.md): [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;&lt;Error class: unknown class&gt;&lt;[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)&gt;&gt;<br>The response headers as name / value pairs, in arrival order. |
| [isOk](isOk.md) | [common]<br>val [isOk](isOk.md): [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)<br>True for a 2xx status. |
| [reason](reason.md) | [common]<br>val [reason](reason.md): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) |
| [status](status.md) | [common]<br>val [status](status.md): [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) |

## Functions

| Name | Summary |
|---|---|
| [header](header.md) | [common]<br>fun [header](header.md)(name: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)?<br>The first value of header [name](header.md), matched without regard to case, or null. |
| [text](text.md) | [common]<br>fun [text](text.md)(): [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)<br>The body decoded as UTF-8 text. |