Package-level declarations

Types

Link copied to clipboard
typealias OnUploadCallback = suspend (uploaded: Long, count: Long) -> Unit

A callback function type for tracking upload progress.

Link copied to clipboard
data class UniUploadFileInfo(val fileName: FileName, val mimeType: String, val inputAllocator: LambdaInputProvider)

Information about a file to upload in a multipart request. This allows uploading from custom sources beyond regular files.

Functions

Link copied to clipboard
inline suspend fun <T : Any> ERROR CLASS: Symbol not found for HttpResponse.bodyOrNull(statusFilter: (ERROR CLASS: Symbol not found for HttpResponse) -> Boolean = { it.status == HttpStatusCode.OK }): ERROR CLASS: Unresolved name: body??

Returns the response body as type T if the statusFilter condition is met, otherwise returns null. By default, the filter checks if the status code is HttpStatusCode.OK.

Link copied to clipboard
inline suspend fun <T : Any> ERROR CLASS: Symbol not found for HttpResponse.bodyOrNullOnNoContent(): ERROR CLASS: Unresolved name: body

Returns the response body as type T if the status code is not HttpStatusCode.NoContent, otherwise returns null. This is useful for handling responses that may return 204 No Content.

Link copied to clipboard
inline fun <T : Any> ERROR CLASS: Symbol not found for HttpClient.createStandardWebsocketFlow(url: String, noinline checkReconnection: suspend (Throwable?) -> Boolean = { true }, noinline requestBuilder: ERROR CLASS: Symbol not found for HttpRequestBuilder.() -> Unit = {}): Flow<T>
Link copied to clipboard
fun MPPFile.inputProvider(): ERROR CLASS: Symbol not found for InputProvider

Creates a Ktor InputProvider from this multiplatform file for use in HTTP client requests. The input provider knows the file size and can create input streams on demand.

Link copied to clipboard
fun MPPFile.inputProviderSync(): ERROR CLASS: Symbol not found for InputProvider
Link copied to clipboard
inline fun <T : Any> openBaseWebSocketFlow(noinline checkReconnection: suspend (Throwable?) -> Boolean = { true }, noinline webSocketSessionRequest: suspend SendChannel<T>.() -> Unit): Flow<T>
Link copied to clipboard
inline fun <T : Any> ERROR CLASS: Symbol not found for HttpClient.openSecureWebSocketFlow(url: String, noinline checkReconnection: suspend (Throwable?) -> Boolean = { true }, noinline requestBuilder: ERROR CLASS: Symbol not found for HttpRequestBuilder.() -> Unit = {}): Flow<T>
Link copied to clipboard
inline fun <T : Any> ERROR CLASS: Symbol not found for HttpClient.openWebSocketFlow(url: String, noinline checkReconnection: suspend (Throwable?) -> Boolean = { true }, noinline requestBuilder: ERROR CLASS: Symbol not found for HttpRequestBuilder.() -> Unit = {}): Flow<T>
inline fun <T : Any> ERROR CLASS: Symbol not found for HttpClient.openWebSocketFlow(url: String, useSecureConnection: Boolean, noinline checkReconnection: suspend (Throwable?) -> Boolean = { true }, noinline requestBuilder: ERROR CLASS: Symbol not found for HttpRequestBuilder.() -> Unit = {}): Flow<T>
Link copied to clipboard
suspend fun tempUpload(fullTempUploadDraftPath: String, file: MPPFile, onUpload: ERROR CLASS: Symbol not found for ProgressListener): TemporalFileId
Link copied to clipboard
expect suspend fun ERROR CLASS: Symbol not found for HttpClient.tempUpload(fullTempUploadDraftPath: String, file: MPPFile, onUpload: ERROR CLASS: Symbol not found for ProgressListener = ProgressListener { _, _ -> }): TemporalFileId

Uploads a file to a temporary storage on the server. The server should provide an endpoint that accepts multipart uploads and returns a TemporalFileId.

actual suspend fun ERROR CLASS: Symbol not found for HttpClient.tempUpload(fullTempUploadDraftPath: String, file: MPPFile, onUpload: ERROR CLASS: Symbol not found for ProgressListener): TemporalFileId
actual suspend fun ERROR CLASS: Symbol not found for HttpClient.tempUpload(fullTempUploadDraftPath: String, file: MPPFile, onUpload: ERROR CLASS: Symbol not found for ProgressListener): TemporalFileId
Link copied to clipboard
inline fun ERROR CLASS: Symbol not found for HttpResponse.throwOnUnsuccess(unsuccessMessage: () -> String)

Throws a ClientRequestException if this HttpResponse does not have a successful status code. A status code is considered successful if it's in the 2xx range.

Link copied to clipboard
expect suspend fun <T> ERROR CLASS: Symbol not found for HttpClient.uniUpload(url: String, data: Map<String, Any>, resultDeserializer: DeserializationStrategy<T>, headers: ERROR CLASS: Symbol not found for Headers = Headers.Empty, stringFormat: StringFormat = Json, onUpload: ERROR CLASS: Symbol not found for ProgressListener = ProgressListener { _, _ -> }): T?

Will execute submitting of multipart data request

suspend fun <T> ERROR CLASS: Symbol not found for HttpClient.uniUpload(url: String, file: MPPFile, resultDeserializer: DeserializationStrategy<T>, additionalData: Map<String, Any> = emptyMap(), headers: ERROR CLASS: Symbol not found for Headers = Headers.Empty, stringFormat: StringFormat = Json, onUpload: ERROR CLASS: Symbol not found for ProgressListener = ProgressListener { _, _ -> }): T?

Additional variant of uniUpload which will unify sending of some MPPFile with the server

suspend fun <T> ERROR CLASS: Symbol not found for HttpClient.uniUpload(url: String, info: UniUploadFileInfo, resultDeserializer: DeserializationStrategy<T>, additionalData: Map<String, Any> = emptyMap(), headers: ERROR CLASS: Symbol not found for Headers = Headers.Empty, stringFormat: StringFormat = Json, onUpload: ERROR CLASS: Symbol not found for ProgressListener = ProgressListener { _, _ -> }): T?

Additional variant of uniUpload which will unify sending of some UniUploadFileInfo with the server

suspend fun <T> ERROR CLASS: Symbol not found for HttpClient.uniUpload(url: String, fileName: FileName, mimeType: String, inputAllocator: LambdaInputProvider, resultDeserializer: DeserializationStrategy<T>, additionalData: Map<String, Any> = emptyMap(), headers: ERROR CLASS: Symbol not found for Headers = Headers.Empty, stringFormat: StringFormat = Json, onUpload: ERROR CLASS: Symbol not found for ProgressListener = ProgressListener { _, _ -> }): T?

Additional variant of uniUpload which will unify sending of some UniUploadFileInfo (built from fileName, mimeType and inputAllocator) with the server