Params

data class Params(val url: String, val headers: Map<String, String>?, val timeouts: TimeoutsSchema? = null, val body: Any?, val httpMethod: HttpMethod, val targetFileName: String, val mimeType: String? = null, val onProgress: suspend (Float) -> Unit = {}, val onDownloadFinished: suspend () -> Unit = {}, val onDownloadFailure: suspend (Throwable) -> Unit = {})

Constructors

Link copied to clipboard
constructor(url: String, headers: Map<String, String>?, timeouts: TimeoutsSchema? = null, body: Any?, httpMethod: HttpMethod, targetFileName: String, mimeType: String? = null, onProgress: suspend (Float) -> Unit = {}, onDownloadFinished: suspend () -> Unit = {}, onDownloadFailure: suspend (Throwable) -> Unit = {})

Properties

Link copied to clipboard
val body: Any?

request body.

Link copied to clipboard

request headers.

Link copied to clipboard
val httpMethod: HttpMethod

HTTP method.

Link copied to clipboard

content type describing the saved file.

Link copied to clipboard
val onDownloadFailure: suspend (Throwable) -> Unit

called if the download fails, with the causing throwable.

Link copied to clipboard
val onDownloadFinished: suspend () -> Unit

called once the file is fully written.

Link copied to clipboard
val onProgress: suspend (Float) -> Unit

called repeatedly with download progress (0f–1f).

Link copied to clipboard

name the downloaded file is saved under.

Link copied to clipboard

request, connect and socket timeout overrides.

Link copied to clipboard
val url: String

endpoint to download from.