HttpApi

class HttpApi(val root: URL, val mapper: <Error class: unknown class> = defaultMapper)

Constructors

Link copied to clipboard
constructor(root: URL, mapper: <Error class: unknown class> = defaultMapper)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val mapper: <Error class: unknown class>
Link copied to clipboard
val root: URL

Functions

Link copied to clipboard
inline fun <T : Any> getJson(path: String, params: Map<String, String> = mapOf()): T

Send a GET request to the path on the API specified.

Link copied to clipboard
fun postJson(path: String, data: Any = Unit)

Send a POST with a payload to the path on the API specified.

Link copied to clipboard
fun postPlain(path: String, data: String = "")

Send a POST with a payload to the path on the API specified.

Link copied to clipboard
fun putJson(path: String, data: Any = Unit)

Send a PUT with a payload to the path on the API specified.