Package-level declarations

Types

Link copied to clipboard
Link copied to clipboard
data class AfterCtx<T>(val req: HttpRequest, val resp: HttpResponse, val data: T)
Link copied to clipboard
interface AfterHook
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
data class BeforeCtx<T>(val subCallRunner: CallRunner<T>, val cookieJar: CookieJar, val req: HttpRequest, val data: T, val id: UUID)
Link copied to clipboard
interface BeforeHook
Link copied to clipboard
sealed class Body
Link copied to clipboard
class BodyBuilder<T>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
class BytesRequestBody(val body: InputStream) : Body
Link copied to clipboard
data class Call<T>(val url: String, val urlProvider: URLProvider<T>?, val concurrency: Int?, val rateOptions: RateLimitOptions?, val cookieJar: CookieJar?, val headers: Map<String, List<HeaderValue>>, val type: HttpMethod, val dataSupplier: RequestDataSupplier<T>?, val body: HttpBody<T>?, val onError: OnError?, val beforeHooks: List<BeforeHook>, val afterHooks: List<AfterHook>, val lifecycleController: LifecycleController? = null)

A build call, generally should not be built directly and should be built by using CallBuilder. This often happens automatically by using the runHttp block

Link copied to clipboard
open class CallBuilder<T>(url: String = "")
Link copied to clipboard
interface CallDecorator<T>
Link copied to clipboard
typealias CallRunner<T> = (Call<T>) -> Exception?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
object EmptyBody : Body
Link copied to clipboard
class Envelope<T>(message: T, maxRetries: Int = 3, expires: Instant?)
Link copied to clipboard
data class Failure<out E : Throwable>(val err: E) : HttpResult<Nothing, E>
Link copied to clipboard
typealias Form = Map<String, List<String>>
Link copied to clipboard
data class FormPart(val key: String, val value: FormTypes)
Link copied to clipboard
class FormRequestBody(val form: Map<String, List<String>>) : Body
Link copied to clipboard
sealed class FormTypes
Link copied to clipboard
Link copied to clipboard
sealed class HeaderValue
Link copied to clipboard
data class HttpBody<T>(val bodyValue: String?, val bodyValueMapper: ValueMapper<String, T>?, val rawValue: (RequestData<T>) -> InputStream?, val formData: Map<String, List<String>>?, val formMapper: ValueMapper<Map<String, List<String>>, T>?, val multipartForm: List<FormPart>?, val lazyMultipartForm: RequestData<T>.() -> List<FormPart>?, val jsonObject: Any?, val lazyJsonObject: (RequestData<T>) -> Any?)
Link copied to clipboard
Link copied to clipboard
class HttpRequest(val type: HttpMethod, val url: String, val body: Body)
Link copied to clipboard
data class HttpResponse(var uri: URI, val statusCode: Int, val headers: Map<String, List<String>>, var body: ByteArray, val requestStartTime: Instant = Instant.now(), val responseStartTime: Instant = Instant.now(), val requestDuration: Duration = Duration.ZERO)
Link copied to clipboard
sealed class HttpResult<out T, out E>
Link copied to clipboard
class JsonRequestBody(val data: Any) : Body
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
typealias MustVisitor<T, V> = (V) -> T
Link copied to clipboard
class NumberType(val i: Number) : FormTypes
Link copied to clipboard
interface OnError
Link copied to clipboard
Link copied to clipboard
interface OutputFormat
Link copied to clipboard
data class ProvidedHeaderValue(val lambda: (RequestData<*>) -> String) : HeaderValue
Link copied to clipboard
data class RateLimitOptions(val enabled: Boolean, val count: Int, val duration: Duration)
Link copied to clipboard
interface ReplaceableValue<T, V>
Link copied to clipboard
abstract class RequestData<T>
Link copied to clipboard
Link copied to clipboard
typealias RequestVisitor<T, V> = (V, Class<*>) -> T
Link copied to clipboard

Used to reify request data into its real type without requiring visitor use. Can be used incorrectly without compilation warnings - use with care.

Link copied to clipboard
data class Session(val calls: List<Call<*>>, val concurrency: Int = 100, val delay: Long?, val rateOptions: RateLimitOptions)

A session that may be passed to the DSL engine to run. Generally these sessions should be created by SessionBuilder through the use of the runHttp block. Explicit instantiation should be reserved for testing only.

Link copied to clipboard
Link copied to clipboard
interface SessionManager
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
data class StrHeaderValue(val value: String) : HeaderValue
Link copied to clipboard
class StringRequestBody(val body: String) : Body
Link copied to clipboard
class StringType(val i: String) : FormTypes
Link copied to clipboard
data class Success<out T>(val value: T) : HttpResult<T, Nothing>
Link copied to clipboard
typealias URLProvider<T> = (String, RequestData<T>) -> String
Link copied to clipboard
typealias ValueMapper<V, T> = (V, RequestData<T>) -> V
Link copied to clipboard
object Version

Version contains the current version defined in the build.gradle root file.

Functions

Link copied to clipboard
@JvmName(name = "afterAction")
fun <T> AfterBuilder<T>.action(block: AfterCtx<T>.() -> Unit)
@JvmName(name = "beforeAction")
fun <T> BeforeBuilder<T>.action(block: BeforeCtx<T>.() -> Unit)
Link copied to clipboard
inline fun <T> RequestData<*>.mustGet(): T
Link copied to clipboard
inline fun <T, V> RequestData<*>.mustVisit(crossinline visitor: MustVisitor<T, V>): T
Link copied to clipboard
fun replaceString(changes: Map<String, String>, str: String): String
Link copied to clipboard
Link copied to clipboard

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard