Package-level declarations

Types

Link copied to clipboard
class SlinkHttpException(val url: String, val code: Int, val responseBody: String) : RuntimeException

Functions

Link copied to clipboard
fun OkHttpClient.Builder.baseUrl(baseUrl: String): OkHttpClient.Builder
Link copied to clipboard
fun Response.checkOk(): Response
Link copied to clipboard
fun Response.checkStatus(vararg successCodes: Int): Response
Link copied to clipboard
fun OkHttpClient.get(url: String, headers: Map<String, String> = emptyMap()): Response
Link copied to clipboard
fun OkHttpClient.head(url: String, headers: Map<String, String> = emptyMap()): Response
Link copied to clipboard
fun OkHttpClient.Builder.ignoreSslErrors(): OkHttpClient.Builder
Link copied to clipboard
fun Response.isOk(): Boolean
Link copied to clipboard
fun newHttpClient(init: OkHttpClient.Builder.() -> Unit = { }): OkHttpClient
Link copied to clipboard
fun OkHttpClient.Builder.noRedirects(): OkHttpClient.Builder
Link copied to clipboard
fun OkHttpClient.post(url: String, data: String, mediaType: String, headers: Map<String, String> = emptyMap()): Response
Link copied to clipboard
fun OkHttpClient.postForm(url: String, data: Map<String, Any>, headers: Map<String, String> = emptyMap()): Response
Link copied to clipboard
fun Response.text(): String
Link copied to clipboard
fun <T> Response.withBody(handler: (Long, InputStream) -> T): T
Link copied to clipboard
fun Response.writeTo(file: File): File
fun Response.writeTo(outputStream: OutputStream)

Properties

Link copied to clipboard
const val HTTP_CREATED: Int = 201
Link copied to clipboard
const val HTTP_OK: Int = 200