HttpClient

object HttpClient

Types

Link copied to clipboard
object MediaTypes

Properties

Link copied to clipboard
val client: OkHttpClient

API client

Link copied to clipboard
Link copied to clipboard
val EMPTY_HEADERS: Headers

Unfortunately, Lunar Client uses OkHttp 4.12.0 which does not have Headers.EMPTY

Functions

Link copied to clipboard
suspend fun download(url: String, file: File, agent: String = DEFAULT_AGENT, progressListener: OkHttpProgressInterceptor.ProgressListener? = null): Long
Link copied to clipboard
suspend fun request(url: String, method: HttpMethod, agent: String = DEFAULT_AGENT, headers: Headers.Builder.() -> Unit = {}, body: RequestBody? = null, progressListener: OkHttpProgressInterceptor.ProgressListener? = null): Response
Link copied to clipboard
fun Call.sendAsync(): CompletableFuture<Response>