class HttpApi
HttpApi(root: URL, mapper: <ERROR CLASS> = defaultMapper) |
val mapper: <ERROR CLASS> |
|
val root: URL |
fun <T : Any> getJson(path: String, params: Map<String, String> = mapOf()): T
Send a GET request to the path on the API specified. |
|
fun postJson(path: String, data: Any = Unit): Unit
Send a POST with a payload to the path on the API specified. |
|
fun postPlain(path: String, data: String = ""): Unit
Send a POST with a payload to the path on the API specified. |
|
fun putJson(path: String, data: Any = Unit): Unit
Send a PUT with a payload to the path on the API specified. |
fun fromHostAndPort(hostAndPort: NetworkHostAndPort, base: String, protocol: String = "http", mapper: <ERROR CLASS> = defaultMapper): HttpApi |
fun Any.contextLogger(): <ERROR CLASS>
When called from a companion object, returns the logger for the enclosing class. |