Package-level declarations

Types

Link copied to clipboard
class AcquiringRateLimiter(rateLimitOptions: RateLimitOptions, clock: Clock = Clock.systemUTC())

This rate limiter isn't perfect but aims to ensure the rate isn't going too fast, and that the rate is smooth. This means that calls to acquire will only unblock one at a time. If two concurrent calls are made to acquire, then the first will unblock straight away. The second one will unblock after 1 / QPS seconds.

Link copied to clipboard
data class Config(val followRedirects: Boolean, val socketTimeout: Int, val connectTimeout: Int, val connectionRequestTimeout: Int)
Link copied to clipboard

Timeouts. Use 0 to specify infinite. Negative value mean to use the system's default value.

Link copied to clipboard
typealias Contents<T> = Pair<HttpRequest, RequestData<T>>
Link copied to clipboard
class DefaultCookieJar : CookieJar
Link copied to clipboard
interface Driver : AutoCloseable
Link copied to clipboard
Link copied to clipboard
class HttpDriver(clientAdapter: HttpClientAdapter) : Driver
Link copied to clipboard
class HttpSessionManager(engine: Driver) : SessionManager, AutoCloseable
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
typealias KtorResponse = HttpResponse
Link copied to clipboard
class KtorResponseMapper(uriMapper: (KtorResponse) -> URI = { URI(it.call.request.url.toString()) })
Link copied to clipboard
class ListRequestData<T>(parts: T, type: Class<T>) : RequestData<T>
Link copied to clipboard
Link copied to clipboard
data class PollPredicateCtx<T>(val req: HttpRequest, val resp: HttpResponse, val data: T)
Link copied to clipboard
class PollUntil<T>(predicate: PollPredicate<T>, clazz: Class<T>, data: T) : CallDecorator<T> , ResolvedFullDataAfterHook<T> , RequestDataSupplier<T>

PollUntil allows one to set up a DSL context that ensures that a request will poll until such a time that the predicate returns true. Due to how this request type works, the concurrency is set at 1.

Link copied to clipboard
class ReplacingString<V>(inString: String) : Function2<V, Class<*>, String>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
class SingleUseDataSupplier<T>(supply: List<String> = listOf()) : RequestDataSupplier<T>
Link copied to clipboard
Link copied to clipboard
class TimedTicket(millSteps: Long, clock: Clock)

This class is split out from the Rate limiter to allow for better testing It effectively should manage the timesteps in which a request ticket can be allowed

Functions

Link copied to clipboard
fun <T> defaultUrlProvider(url: String, data: RequestData<T>): String
Link copied to clipboard
fun <T> getBodyProvider(call: Call<T>, data: RequestData<T>): Body
Link copied to clipboard
fun <T> getUrlProvider(call: Call<T>): URLProvider<T>
Link copied to clipboard
fun <T> handleNoSupplier(data: RequestDataSupplier<T>?): RequestDataSupplier<T>
Link copied to clipboard
fun runHttp(block: SessionBuilder.() -> Unit)
fun runHttp(config: ConfigBuilder.() -> Unit, block: SessionBuilder.() -> Unit)
fun runHttp(engine: Driver, block: SessionBuilder.() -> Unit)