Package dev.fritz2.remote

Types

Authentication
Link copied to clipboard
js
interface Authentication
Represents the functions needed to authenticate a user and in which cases the authentication should be made.
CloseException
Link copied to clipboard
js
class CloseException(message: String, throwable: Throwable) : Exception
Exception for handling errors with closing
ConnectionException
Link copied to clipboard
js
class ConnectionException(message: String, throwable: Throwable) : Exception
Exception for handling errors with connecting
FetchException
Link copied to clipboard
js
class FetchException(statusCode: Short, body: String, response: Response) : Exception
Exception type for handling http exceptions
Request
Link copied to clipboard
js
open class Request(baseUrl: String, headers: Map<String, String>, body: dynamic, referrer: String?, referrerPolicy: dynamic, mode: RequestMode?, credentials: RequestCredentials?, cache: RequestCache?, redirect: RequestRedirect?, integrity: String?, keepalive: Boolean?, reqWindow: Any?, authentication: Authentication?)
Represents the common fields an attributes of a given set of http requests.
SendException
Link copied to clipboard
js
class SendException(message: String) : Exception
Exception for handling errors with sending
Session
Link copied to clipboard
js
open class Session(webSocket: WebSocket)
Session represents a session via websocket after connection was successful.
SessionState
Link copied to clipboard
js
sealed class SessionState
SessionState represents the actual state of the websocket connection.
Socket
Link copied to clipboard
js
open class Socket(baseUrl: String, protocols: Array<out String>)
Socket defines how to connect via websocket.

Functions

btoa
Link copied to clipboard
js
external fun btoa(decoded: String): String
getArrayBuffer
Link copied to clipboard
js
suspend fun Response.getArrayBuffer(): ArrayBuffer
extracts the body as arrayBuffer from the given Response
getBlob
Link copied to clipboard
js
suspend fun Response.getBlob(): Blob
extracts the body as blob from the given Response
getBody
Link copied to clipboard
js
suspend fun Response.getBody(): String
extracts the body as string from the given Response
getFormData
Link copied to clipboard
js
suspend fun Response.getFormData(): FormData
extracts the body as formData from the given Response
getHeaders
Link copied to clipboard
js
fun Response.getHeaders(): Headers
returns the Headers from the given Response
getJson
Link copied to clipboard
js
suspend fun Response.getJson(): Any?
extracts the body as json from the given Response
http
Link copied to clipboard
js
fun http(baseUrl: String = ""): Request
creates a new Request
websocket
Link copied to clipboard
js
fun websocket(url: String, vararg protocols: String): Socket
creates a new Socket for bidirectional communication with the server.

Properties

arrayBuffer
Link copied to clipboard
js
val Flow<MessageEvent>.arrayBuffer: Flow<ArrayBuffer>
gives the MessageEvent.data as Flow of ArrayBuffer
blob
Link copied to clipboard
js
val Flow<MessageEvent>.blob: Flow<Blob>
gives the MessageEvent.data as Flow of Blob
body
Link copied to clipboard
js
val Flow<MessageEvent>.body: Flow<String>
gives the MessageEvent.data as Flow of String
closes
Link copied to clipboard
js
val Session.closes: Flow<CloseEvent>
gives a Flow of CloseEvent when Session closes
data
Link copied to clipboard
js
val Flow<MessageEvent>.data: Flow<Any?>
gives the MessageEvent.data as Flow of Any
isClosed
Link copied to clipboard
js
val Session.isClosed: Flow<Boolean>
gives a Flow of Boolean when SessionState is SessionState.Closed
isConnecting
Link copied to clipboard
js
val Session.isConnecting: Flow<Boolean>
isOpen
Link copied to clipboard
js
val Session.isOpen: Flow<Boolean>
gives a Flow of Boolean when SessionState is SessionState.Open
opens
Link copied to clipboard
js
val Session.opens: Flow<Event>
gives a Flow of Event when Session opens