Using REST services
The pl.treksoft.kvision.rest.RestClient
class can be used to connect to any RESTfull services (it will work with any JSON over HTTP services). You can use remote services with both dynamic and type-safe calls (using @Serializable
classes). The remoteCall
and call
methods of RestClient
class return kotlin.js.Promise
object.
Dynamic parameters, dynamic result
Dynamic parameters, type-safe result
Type-safe parameters, dynamic result
Type-safe parameters, type-safe result
Note: The Promise
object can be used directly or easily transformed to the Kotlin coroutine with asDeferred
extension function (you need the kotlinx.coroutines library dependency).
Last updated