Params

data class Params(val url: String, val headers: Map<String, String>?, val body: Any?, val httpMethod: HttpMethod, val targetFileName: String, 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>?, body: Any?, httpMethod: HttpMethod, targetFileName: String, 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
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 file is saved under, in the app's private storage.

Link copied to clipboard
val url: String

endpoint to download from.