Package-level declarations

Types

Link copied to clipboard
enum Header : Enum<Header>

Enum class representing HTTP header.

Link copied to clipboard
class Klopik(val baseUrl: String = "", options: RequestOptions.() -> Unit = {})

The Klopik class is used to create an instance of an HTTP client with a base URL and default request options.

Link copied to clipboard
enum Method : Enum<Method>

Enum class representing HTTP methods.

Link copied to clipboard
typealias StreamCallback = (ByteArray) -> Unit

This is a callback function for handling streams of data. Each time a chunk of data is received, this function will be called.

Functions

Link copied to clipboard
fun Klopik.Companion.delete(url: String, options: RequestOptions.() -> Unit = {}): Request

Creates a DELETE request to the specified URL.

Link copied to clipboard
fun Klopik.Companion.get(url: String, options: RequestOptions.() -> Unit = {}): Request

Creates a GET request to the specified URL.

Link copied to clipboard
fun Klopik.Companion.head(url: String, options: RequestOptions.() -> Unit = {}): Request

Creates a HEAD request to the specified URL.

Link copied to clipboard
fun Klopik.Companion.options(url: String, options: RequestOptions.() -> Unit = {}): Request

Creates a OPTIONS request to the specified URL.

Link copied to clipboard
fun Klopik.Companion.patch(url: String, options: RequestOptions.() -> Unit = {}): Request

Creates a PATCH request to the specified URL.

Link copied to clipboard
fun Klopik.Companion.post(url: String, options: RequestOptions.() -> Unit = {}): Request

Creates a POST request to the specified URL.

Link copied to clipboard
fun Klopik.Companion.put(url: String, options: RequestOptions.() -> Unit = {}): Request

Creates a PUT request to the specified URL.

Link copied to clipboard
fun Klopik.Companion.request(method: Method, url: String, options: RequestOptions.() -> Unit = {}): Request

Creates a request to the specified URL with the specified method and options.

toHeaders
Link copied to clipboard
fun Map<String, String>.toHeaders(): Headers
fun Map<String, String>.toHeaders(): Headers