Package-level declarations

Types

Link copied to clipboard
Link copied to clipboard
class HttpReceivePipeline(val developmentMode: Boolean = false) : Pipeline<HttpResponse, Unit>

HttpClient Pipeline used for receiving HttpResponse without any processing.

Link copied to clipboard
abstract class HttpResponse : HttpMessage, CoroutineScope

An HttpClient's response, a second part of HttpClientCall.

Link copied to clipboard
data class HttpResponseContainer(val expectedType: TypeInfo, val response: Any)

Class representing a typed response with an attached expectedType.

Link copied to clipboard

HttpClient Pipeline used for executing HttpResponse.

Link copied to clipboard

Prepared statement for a HTTP client request. This statement doesn't perform any network requests until execute method call. HttpStatement is safe to execute multiple times.

Functions

Link copied to clipboard
Link copied to clipboard
suspend fun HttpResponse.bodyAsText(fallbackCharset: Charset = Charsets.UTF_8): String

Reads the HttpResponse.content as a String. You can pass an optional charset to specify a charset in the case no one is specified as part of the Content-Type response. If no charset specified either as parameter or as part of the response, io.ktor.client.plugins.HttpPlainText settings will be used.

Link copied to clipboard

Efficiently discards the remaining bytes of HttpResponse.content.

Link copied to clipboard

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

suspend fun HttpResponse.readBytes(count: Int): ByteArray

Reads exactly count bytes of the HttpResponse.content.

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

Read the HttpResponse.content as a String. You can pass an optional charset to specify a charset in the case no one is specified as part of the Content-Type response. If no charset specified either as parameter or as part of the response, io.ktor.client.plugins.HttpPlainText settings will be used.

Link copied to clipboard
inline suspend fun <T> HttpStatement.receive(): T

Executes this statement and run HttpClient.responsePipeline with the response and expected type T.

inline suspend fun <T, R> HttpStatement.receive(crossinline block: suspend (response: T) -> R): R

Executes this statement and run the block with a HttpClient.responsePipeline execution result.

Properties

Link copied to clipboard

Gets HttpRequest associated with this response.