Package io.ktor.client.utils

Types

Link copied to clipboard
class ByteBufferPool : DefaultPool<ByteBuffer>
Link copied to clipboard
object CacheControl

List of CacheControl known values.

Link copied to clipboard
object EmptyContent : OutgoingContent.NoContent

Concrete OutgoingContent without a payload.

Functions

Link copied to clipboard
fun buildHeaders(block: HeadersBuilder.() -> Unit = {}): Headers

Builds an instance of Headers using the block function.

Link copied to clipboard
expect fun Dispatchers.clientDispatcher(threadCount: Int, dispatcherName: String = "ktor-client-dispatcher"): CoroutineDispatcher

Creates CoroutineDispatcher for client with fixed threadCount and specified dispatcherName.

actual fun Dispatchers.clientDispatcher(threadCount: Int, dispatcherName: String = "ktor-client-dispatcher"): CoroutineDispatcher

Creates CoroutineDispatcher based on thread pool of threadCount threads.

actual fun Dispatchers.clientDispatcher(threadCount: Int, dispatcherName: String = "ktor-client-dispatcher"): CoroutineDispatcher

Creates CoroutineDispatcher for client with fixed threadCount and specified dispatcherName.

Link copied to clipboard
fun Dispatchers.fixedThreadPoolDispatcher(threadCount: Int, dispatcherName: String = "client-dispatcher"): CoroutineDispatcher

Creates CoroutineDispatcher based on thread pool of threadCount threads.

Link copied to clipboard
expect fun Throwable.unwrapCancellationException(): Throwable

If the exception contains cause that differs from CancellationException returns it otherwise returns itself.

actual fun Throwable.unwrapCancellationException(): Throwable

If the exception contains cause that differs from CancellationException returns it otherwise returns itself.

actual fun Throwable.unwrapCancellationException(): Throwable

If the exception contains cause that differs from CancellationException returns it otherwise returns itself.

Link copied to clipboard
fun OutgoingContent.wrapHeaders(block: (Headers) -> Headers): OutgoingContent

Generates a new OutgoingContent of the same abstract type but with OutgoingContent.headers transformed by the specified block.

Properties

Link copied to clipboard
const val DEFAULT_HTTP_BUFFER_SIZE: Int = 4096

Size of each buffer in the HttpClientDefaultPool.

Link copied to clipboard
const val DEFAULT_HTTP_POOL_SIZE: Int = 1000

Maximum number of buffers to be allocated in the HttpClientDefaultPool.

Link copied to clipboard
val HttpClientDefaultPool: ByteBufferPool

Singleton pool of ByteBuffer objects used for HttpClient.