HttpResponse

class HttpResponse : CoroutineScope, HttpMessage

Properties

Link copied to clipboard
open override val coroutineContext: CoroutineContext
Link copied to clipboard
open override val headers: Headers

Extensions

Link copied to clipboard
suspend fun HttpResponse.discardRemaining()

Efficiently discards the remaining bytes of HttpResponse.content.

Link copied to clipboard
suspend fun HttpResponse.readBytes(count: Int): ByteArray

Exactly reads count bytes of the HttpResponse.content.

suspend fun HttpResponse.readBytes(): ByteArray

Reads the whole HttpResponse.content if Content-Length was specified. Otherwise it just reads one byte.

Link copied to clipboard
suspend fun HttpResponse.readText(charset: Charset? = null): String